Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hi all,
I have a Field [METRICS] which calculates a percentage from another field [CONT] (Contains Sales, MArgin, Budget by POS Name) which is joined to field [CSD] that contains POS Names (Eg. Centre1, Centre2).
There are other fields which contain different data and [METRICS] field creates calculations from those.
The % Calc in the metric is MtTrgt_% = sum(CONT[Margin]) / sum(CONT[Margin Budget])
What I would like to do is rank this %, however, when I rank on this metric it just shows 1 not a full rank, what I am doing wrong?
Rank Calc = RANK(DENSE,ALLSELECTED('CSD'[POS Name]), ORDERBY (MtTrgt_%],desc) )
Many Thanks
Alex
@villa1980 , Try using DAX
Rank Calc =
RANKX(
ALL('CSD'[POS Name]),
[MtTrgt_%],
,
DESC,
DENSE
)
Proud to be a Super User! |
|
My apologies that seems to work brilliantly thank-you, I have another issue now, if I bring in POS No into the table the Ranking reverts back to one.
How do I overcome this issue?
Thanks
Hi @villa1980 ,
Try below expression:
Measure = var _t = ADDCOLUMNS('CSD',"RANK",RANKX(FILTER(ALL('CSD'),[POS NAME]=EARLIER([POS NAME])),[MtTrgt_%],,DESC,Dense))
RETURN MAXX(_t,[Rank])
Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Thank-you for your reply, that has worked very well thank-you.
This should be an easy one, I have managed to produce a rank calculation based on a hirarchy which is below. However it is ranking blanks, I know I need Not (ISBLANK(....but am unsure where I put this within this calculation.
Any Help would be appreciated.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 61 | |
| 47 | |
| 39 | |
| 23 | |
| 23 |
| User | Count |
|---|---|
| 144 | |
| 106 | |
| 63 | |
| 38 | |
| 31 |