cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

how to count values of a measure

 

Hi Experts,

I need help on how to count data that is resulted from a measure. 

 

As per the below screenshot, I used the "Datadiff" function to get the numbers between 2 different dates "POR to Scopping" . Now i need to count how many "POR to scopping" that are more than 14 . The problem is that "POR to Scopping" is a measure and i can't get the "Count " function to work for measures and it only worke for columns!

 

Count a measure.JPG

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: how to count values of a measure

Use COUNTX or COUNTROWS. Build a table using FILTER and perhaps ADDCOLUMNS that represents your table. Then use COUNTX against that table, perhaps with an additional filter for > 14. For example:

 

Measure Count = 
VAR __table = ALL('Table')
VAR __table1 = ADDCOLUMNS(__table,"__MyMeasure",[Measure])
RETURN
COUNTROWS(FILTER(__table1,[__MyMeasure] > 14))

---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Highlighted
Super User IV
Super User IV

Re: how to count values of a measure

Use COUNTX or COUNTROWS. Build a table using FILTER and perhaps ADDCOLUMNS that represents your table. Then use COUNTX against that table, perhaps with an additional filter for > 14. For example:

 

Measure Count = 
VAR __table = ALL('Table')
VAR __table1 = ADDCOLUMNS(__table,"__MyMeasure",[Measure])
RETURN
COUNTROWS(FILTER(__table1,[__MyMeasure] > 14))

---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Highlighted
Frequent Visitor

Re: how to count values of a measure

HI Dreg,

Thanks for the feedback!

 

I got it working by using the below statment :

Number of sites exceeding "POR To Scopping" Std Interval =
CALCULATE(COUNTA('Query1'[Site ID]), FILTER(Query1,Query1[POR to Scoping]>=14),FILTER(Query1,Query1[Site Scoping Sts]="P"))

Helpful resources

Announcements
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors