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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Community Champion
Community Champion

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
Community Champion
Community Champion

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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