Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User

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/
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.