Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
I have the following in which I have to do dynamic Ranking.
First, it should see the region and then based on Total sales
When the region changes, it should start again from 1, (Similar to partition by in SQL).
I'm also attaching the dax function which I tried:
| UserID | Region | Total Sales | Dynamic_Rank |
| 1 | North | 2000 | 2 |
| 2 | North | 3000 | 1 |
| 3 | North | 3000 | 1 |
| 4 | South | 4000 | 1 |
| 5 | South | 4000 | 1 |
| 6 | South | 3500 | 2 |
Solved! Go to Solution.
DAX formula:
Dynamic_Rank =
RANKX(
FILTER(
'YourTableName',
'YourTableName'[Region] = EARLIER('YourTableName'[Region])
),
'YourTableName'[Total Sales],
,
DESC,
Dense
)
If this helped, a Kudos 👍 or Solution mark would be great!
Cheers,
Kedar Pande
www.linkedin.com/in/kedar-pande
Hi Everyone
I want to Rank on basis of amount and also of new month starts then it should rank on basis of amount.
Month Amount Rank
Jan 234 1
Jan 200 2
Jan 100 3
Feb 400 1
Feb 149 2
like this I want , as I have tried everything but it is not coming please help.
Hi @Kedar_Pande ,
Thanks for the Response. This works.
But is this not achievable through RANK function instead of RANKX function.
We have to use RANKX as we have to iterate in the table.
If this helped please Solution mark the original answer
DAX formula:
Dynamic_Rank =
RANKX(
FILTER(
'YourTableName',
'YourTableName'[Region] = EARLIER('YourTableName'[Region])
),
'YourTableName'[Total Sales],
,
DESC,
Dense
)
If this helped, a Kudos 👍 or Solution mark would be great!
Cheers,
Kedar Pande
www.linkedin.com/in/kedar-pande
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 28 | |
| 23 | |
| 18 | |
| 18 | |
| 15 |
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 43 | |
| 35 | |
| 32 |