cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Count a result of a Measure

Hi there geniuses,

 

I have a measure that indicates "yes" or "no" if a salesperson has achieved their target for the month.

 

Now I would like to count the number of salespeople that have achieved their target.

 

I have tried every type of count and calculate but I am not able to get it working.  Can you please help?

 

Cheers

 

Phil

 

 

 

 

1 ACCEPTED SOLUTION

You are welcome.  It works absolutely fine.  You were missing a closing bracket after the VALUES() function.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
Ashish_Mathur
Super User III
Super User III

Hi,

If Yes, No are results of a measure and not a calculated column, then try this

=COUNTROWS(FILTER(VALUES(Data[Salesperson]),[Target Met]="Yes"))

Hope this helps.

If the result is not as per your expectation, then please share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi Ashish

 

That did not work, but many thanks for getting back to me, my sample file is here: 

 

https://drive.google.com/file/d/1U40FNZJVQ8ZszTPYxtOBJwVr3jnDrnns/view?usp=sharing

 

Cheers

You are welcome.  It works absolutely fine.  You were missing a closing bracket after the VALUES() function.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

Anonymous
Not applicable

Thank you!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

 Hi @Ashish_Mathur

 

this is a great fix.   

I wondered if you can help me tune the formula.  

For me, it counts correctly, and when I enter the two measure into a table "yes" and "no", the sum in the table based on slicers is correct. 

When using the "yes" & "no" in a card.  The slicers i have on column 'a' for example do not impact the count.   
The card results in the total counts of "yes" & "no".  

Does this make sense? 

 

Cheers

Thank you.  I am not clear with your question.  Share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Urdu Hindi D365 Bootcamp 768x460.png

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors