Forum Discussion
RANKX formula
1.I need to assign a rank to total sales with respect to the customers irrespective of years.
2. But i need to use years as legend in clustered column chart then i dynamically change years like i choose beween years to check top N customers
3. I need to summarize the total sales bw the selected years then i should assign ranking for the results how to achiev this.
please check image for clarity
THANKS IN ADVANCE
4 Replies
- AnonymousNot applicable
Hi dileep735
Thanks for the reply from Greg_Deckler .
Here is the testing I did, hope it helps.
Create two measures as follow.
Total Sales1 = CALCULATE(SUM('Table'[Total Sales]), FILTER(ALLEXCEPT('Table', 'Table'[customer]), [Year] >= MIN('Time'[Year]) && [Year] <= MAX('Time'[Year])))rank = RANKX(ALL('Table'), [Total Sales1], , DESC, Dense)Output:
Best Regards,
Yulia XuIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Greg_DecklerCommunity Champion
dileep735 See if this helps: To *Bleep* with RANKX! - Microsoft Fabric Community Otherwise, please post sample data as text and expected results.
Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2. - dileepa735Regular Visitor
Thanks its working
- AnonymousNot applicable
Hi dileepa735
Did my answer help you? If so, could you please mark the solution as an ANSWER? This will help more users who are facing the same or similar difficulties. Thank you!
Best Regards,
Yulia Xu