Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.