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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
Most Valuable Professional
Most Valuable Professional

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
Most Valuable Professional
Most Valuable Professional

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.