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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
bcbuckley13
Helper III
Helper III

How do I get count of "Yes" from this new created Dax column?

@Ibendlin created this column for me that calculates whether stores have 2+ Champion badges. I'm trying to get a count of the number of "Yes", but a simple Countrows isn't working.
 
Two Champions equals
var c = CALCULATE(COUNTROWS('Badges'),ALLEXCEPT('Badges','Badges'[Store ID]),'Badges'[Badge Name]="Champion")
return if(c>1,"Yes","No")
 
This was created in Dax, so it's not on my main table. Can I still get a count of the "Yes" from it?
1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @bcbuckley13 

There's 2 answers to this.  There are actually 5 Yes in the Two Champions column

twoch.png

If you want that then create a mesure like this

 

Yes Count = CALCULATE(COUNTROWS('Badges'),FILTER('Badges', 'Badges'[Two Champions] = "Yes" ))

 

 

But if you want a distinct count of store ID's with a Yes then use this - the answer is 2

Yes Count = CALCULATE(DISTINCTCOUNT('Badges'[Store ID]),FILTER('Badges', 'Badges'[Two Champions] = "Yes" ))

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

4 REPLIES 4
PhilipTreacy
Super User
Super User

Hi @bcbuckley13 

There's 2 answers to this.  There are actually 5 Yes in the Two Champions column

twoch.png

If you want that then create a mesure like this

 

Yes Count = CALCULATE(COUNTROWS('Badges'),FILTER('Badges', 'Badges'[Two Champions] = "Yes" ))

 

 

But if you want a distinct count of store ID's with a Yes then use this - the answer is 2

Yes Count = CALCULATE(DISTINCTCOUNT('Badges'[Store ID]),FILTER('Badges', 'Badges'[Two Champions] = "Yes" ))

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


PhilipTreacy
Super User
Super User

Hi @bcbuckley13 

Can you please provide some sample data.

regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hi  @bcbuckley13,

 

You could directly put the column in a table field >choose "count" or "discount",and you will see the value you need:

v-kelly-msft_0-1615172010687.png

Check the .pbix file attached if needed.

 

Best Regards,
Kelly

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

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (1,749)