Forum Discussion
RANKX issue
Hi all,
Got an issue with RANKX.
Here is my data model :
1 Fact table : Sales
2 dimensions tables : Calendar, stores
I want to create a measure to have store's rank over turnover.
I created measure Indicateurs[CA TTC] : SUM('Daily Sales N'[MNT_TTC]) => Sum(TurnOver)
Here is the result :
Hi Anonymous ,
You can use the following measure in your table visual:
Rang CA BU Mois Filtre = var a = SUMMARIZE(ALL(Stores),Stores[Magasin],"CA TTC",[CA TTC Mois],"rank",RANKX(ALL(Stores),CALCULATE([CA TTC Mois],ALLEXCEPT(Stores,Stores[Magasin])),,DESC)) return SUMX(FILTER(a,Stores[Magasin] = MAX(Stores[Magasin])),[rank])If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
14 Replies
- AnonymousNot applicable
- amitchandakSuper User
Anonymous , Measure rank is context-sensitive. You create a Rank on store, It will rank store or store rank inside other group by
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
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/367415- AnonymousNot applicable
I modified my pbix, so i can send it. (70Mo)
How can i send it to you ?
You could give me your @ by private message ?
- v-deddai1-msftCommunity Support
Hi Anonymous ,
Would you please try to use the following rankx measure for it:
RANKX = RANKX(ALL('Stores'[magasin]),CALCULATE(SUM('Daily Sales N'[MNT_TTC])),,DESC)If it dosen't work, would you please try to show us some sample data just contain these three table by onedrive for business?
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai