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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
YunJ
Post Prodigy
Post Prodigy

How to show specific count number?

Hi,

I made a measure "Rank_Sales" which is ranked by Sales, desc. I want to show the number of "State or Province" for which Sales2 is not blank in the Rank=5~10 (5<=Rank_Sales<=10).

For example in the following picture situation, it should show 3 in this case.1.png

Please kindly check the pbix file.

https://www.dropbox.com/s/qci7ig8spxh58c9/countrows.pbix?dl=0

 

Thanks a lot!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@YunJ , Try measures like

Geography Rank = RANKX(allselected(Table[State or Province]),[Sales])
Rank 2nd top = sumx(filter(VALUES(Table[State or Province]),[Geography Rank]>=5 && [Geography Rank]<=10 && not(isblank([sales2]))),[Sales] )

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@YunJ , Try measures like

Geography Rank = RANKX(allselected(Table[State or Province]),[Sales])
Rank 2nd top = sumx(filter(VALUES(Table[State or Province]),[Geography Rank]>=5 && [Geography Rank]<=10 && not(isblank([sales2]))),[Sales] )

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks @amitchandak  One little thing I will use countx rather than sumx to count the numbers of state. Thanks a lot!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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