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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I am trying to rank a seies of values. Here is a sample:
VendorID Total Classification
1 5 N
2 2 N
3 7 P
4 3 P
5 8 E
I would like to rank the vendors within the classification. Here is what I tried, but I get an error:
Solved! Go to Solution.
Hi, @Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create a calculated column or a measure as below.
Calculated column:
Rank Column =
RANKX(
FILTER(
ALL('Table'),
[Classification]=EARLIER('Table'[Classification])
),
[Total]
)
Measure:
Rank Measure =
RANKX(
FILTER(
ALL('Table'),
[Classification]=MAX('Table'[Classification])
),
CALCULATE(SUM('Table'[Total]))
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Create a new calculated measure with below DAX:
Rank_Measure =
RANKX(
FILTER(
ALL('Table'[VendorID],'Table'[Classification]),
'Table'[Classification]=MAX('Table'[Classification])
),
CALCULATE(SUM('Table'[Total]))
)
Give a thumbs up if this post helped you in any way and mark this post as solution if it solved your query !!!
Hi, @Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create a calculated column or a measure as below.
Calculated column:
Rank Column =
RANKX(
FILTER(
ALL('Table'),
[Classification]=EARLIER('Table'[Classification])
),
[Total]
)
Measure:
Rank Measure =
RANKX(
FILTER(
ALL('Table'),
[Classification]=MAX('Table'[Classification])
),
CALCULATE(SUM('Table'[Total]))
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!