The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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.
Please kindly check the pbix file.
https://www.dropbox.com/s/qci7ig8spxh58c9/countrows.pbix?dl=0
Thanks a lot!
Solved! Go to Solution.
@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...
@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...
Thanks @amitchandak One little thing I will use countx rather than sumx to count the numbers of state. Thanks a lot!
User | Count |
---|---|
71 | |
64 | |
62 | |
50 | |
28 |
User | Count |
---|---|
117 | |
75 | |
62 | |
55 | |
43 |