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! Get ahead of the game and start preparing now! Learn more
Hi Community,
The Rankx function doesnt seem to work. Below is the screenshot.
Can anyone please help what wrong am I doing here
Solved! Go to Solution.
You need to use CALCULATE to force context transition
Ranking Sales =
RANKX (
ALL ( Orders[Row ID], Orders[Sales] ),
CALCULATE ( SUM ( Orders[Sales] ) ),
,
DESC,
DENSE
)
Create a measure
You need to use CALCULATE to force context transition
Ranking Sales =
RANKX (
ALL ( Orders[Row ID], Orders[Sales] ),
CALCULATE ( SUM ( Orders[Sales] ) ),
,
DESC,
DENSE
)
Hi @powerbidev123 ,
first you can create mesure of total_sales
revenue = SUM(Sales[SalesAmount])
and after you can create rankx measure and use ALL(sales) table.
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!
| User | Count |
|---|---|
| 21 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 20 | |
| 13 | |
| 11 |