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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
DeepakPandeyPF
Regular Visitor

Rank not Working

Hello All,

 

I am working on a requirement,

In this, I have created a filter of dimension from the parameter field,

 

DeepakPandeyPF_0-1704018159717.png

 

DeepakPandeyPF_1-1704018190795.png

and I want to make it dynamic and get the rank of sales through it,

 

Rank = 
IF(NOT(ISBLANK(Fact_Sales[Total Sale Qty])),RANKX(FILTER(ALL('KPI Selection'[KPI Selection Fields]),
NOT(ISBLANK(Fact_Sales[Total Sale Qty]))),Fact_Sales[Total Sale Qty],,DESC,Dense))

 

Top Sales Dynamically =
Var Rankvisible = IF(NOT(ISBLANK(Fact_Sales[Sales On Selection])),
RANKX(FILTER(ALL('KPI Selection'[KPI Selection Fields]),NOT(ISBLANK(Fact_Sales[Sales On Selection]))),Fact_Sales[Sales On Selection],,DESC,Dense))
Return
IF(Rankvisible <=TopTable[NVALUE],Fact_Sales[Sales On Selection])
 
DeepakPandeyPF_4-1704018563868.png

 

 
DeepakPandeyPF_2-1704018281532.png

but after doing everything, the issue is coming at one place where the rank is returning 1 for everyone.

 

DeepakPandeyPF_3-1704018372596.png

If I select any value from 1 to 10 from the slicer then it should return the value accordingly.

 

I will Thankfull if you help me in this case

 

Thanks

5 REPLIES 5
AmiraBedh
Super User
Super User

Can you please share your model ?


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696
Ashish_Mathur
Super User
Super User

Hi,

Please share the intent.  I see that you are trying to write 2 measures - Rank and Top sales.  What is your ultimate goal?  Share the download link of t he PBI file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

want that if I select any value from the dimensions and select any of the top numbers, then the value of the selected top cells should appear in the result as per the selected dimensions.

AmiraBedh
Super User
Super User

Try the following : 

 

Rank = 
RANKX(
    ALL('KPI Selection'), 
    CALCULATE(SUM(Fact_Sales[Total Sale Qty])), 
    , 
    DESC, 
    DENSE
)

Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

DeepakPandeyPF_0-1704953162395.png

It is showing 1 for all

 

DeepakPandeyPF_1-1704953212772.png

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors