Forum Discussion
dileep735
2 years agoNew Member
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 ch...
Anonymous
2 years agoNot 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 Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.