DAX: Count the weeks where price is over $18

Occasional Contributor

Hi, all. I have a power pivot where I'd like to count the number of weeks where average price exceeded $18. Any help would be greatly appreciated.Count Over $18.png

2 Replies

@Paul_Cracknell 

 

Assuming data in Table1 and the average measure is named Avg Price

 

_Screenshot.png

in E3:

 

=CUBESETCOUNT(
    CUBESET("ThisWorkbookDataModel", "FILTER([Table1].[Week].Children, [Measures].[Avg Price] > 18)")
)

 

@Paul_Cracknell 

 

If you want your filtering value in a cell like in E3 below:

_Screenshot.png

in F3:

=CUBESETCOUNT(
    CUBESET("ThisWorkbookDataModel",
        "(
            FILTER(
                [Table1].[Week].Children,
                [Measures].[Avg Price] > " & E3 & "
            )
        )"
    )
)