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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
nataliesmiy1357
Helper IV
Helper IV

Count with a filter

Hello!  I need some help with my report.  I am trying to count how many courses have the rank of 1, 2, 3 and 4.  I have other filters on the data, so I created a table with the course name and rank.  I need to make a measure calculating how many of those courses are rank 1.  

 

I tried to create something... but it doesn't work.  I get the count of 1, when I need a count of 10.

 

Count of Rank 1 = CALCULATE(DISTINCTCOUNT(V_TM_ModulePowerBI[Rank]), FILTER(V_TM_ModulePowerBI, V_TM_ModulePowerBI[Rank] = 1))
 
Thanks in advance!

nataliesmiy1357_0-1646763558342.png

 

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

HI @nataliesmiy1357 

 

Please try this:-

Count of Rank 1 = CALCULATE(DISTINCTCOUNT(V_TM_ModulePowerBI[course name]), FILTER(V_TM_ModulePowerBI, V_TM_ModulePowerBI[Rank] = 1))

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

1 REPLY 1
Samarth_18
Community Champion
Community Champion

HI @nataliesmiy1357 

 

Please try this:-

Count of Rank 1 = CALCULATE(DISTINCTCOUNT(V_TM_ModulePowerBI[course name]), FILTER(V_TM_ModulePowerBI, V_TM_ModulePowerBI[Rank] = 1))

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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