Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi all,
As shown in the example below, I would like to rank the companies by sales variance. Result should show Top 5 ranking by biggest variance number regardless if it is a -ve or +ve number.
Thanks in advance.
Solved! Go to Solution.
Use the ABS function to render all values positive and then use that in the RANKX measure. (Or new column)
This blog post may help (if you wish to display the actual rank):
Reversing the Y-Axis for ranks
Proud to be a Super User!
Paul on Linkedin.
Rankx(all(Table[compnay]), calculate(abs(sum(table[sales variance]))),,asc,dense)
by adding ABS function it gives the desired output.
Thanks
Hi @mb0307
what about this solution?
Rank = RANKX(ALL('Table'),[Sum of Sales Variance],,DESC)
Regards FrankAT
Use the ABS function to render all values positive and then use that in the RANKX measure. (Or new column)
This blog post may help (if you wish to display the actual rank):
Reversing the Y-Axis for ranks
Proud to be a Super User!
Paul on Linkedin.
@mb0307 , create ascending rank on sales variance
rankx(all(Table[compnay]), calculate(sum(table[sales variance])),,asc,dense)
you can use topN too
https://databear.com/power-bi-dax-topn-function/
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/3...
Rankx(all(Table[compnay]), calculate(abs(sum(table[sales variance]))),,asc,dense)
by adding ABS function it gives the desired output.
Thanks
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |