Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
After trying the full day, I'm hopeless to find the answer, how to rank for one NAME and DATE over the BATCH
batch (number) | date (date) | name (text) | rank |
10 | 1/1/2022 | abc | 1 |
22 | 1/1/2022 | abc | 2 |
22 | 1/1/2022 | abc | 2 |
22 | 1/1/2022 | abc | 2 |
46 | 1/1/2022 | abc | 3 |
46 | 1/1/2022 | abc | 3 |
58 | 5/1/2022 | abc | 1 |
58 | 5/1/2022 | abc | 1 |
67 | 5/1/2022 | abc | 2 |
trying all combination of RANX, FILTER,ALLSELECTED... it returns '1' value only
please help
thanks a lot!
Solved! Go to Solution.
Hi @Anonymous,
Since you want to rank the Batch column for a particular Name and Date, you'll have to consider all the other records in the Name and Date column with that value. Therefore, you'll have to use the EARLIER() function along with RANKX() and FILTER().
Use this DAX Formula:
Rank = RANKX(FILTER('Table','Table'[Date]=EARLIER('Table'[Date])&&'Table'[Name]=EARLIER('Table'[Name])),'Table'[Batch],,ASC,DENSE)
Here's the result:
Works for you? Mark this post as a solution if it does!
What if i would like to do the rank for one coulmn more? For example to create the rank for the batch column for month, name and additional location (paris, berlin, rome, new york, hongkong etc.). Is this possible?
Hi @Anonymous,
Since you want to rank the Batch column for a particular Name and Date, you'll have to consider all the other records in the Name and Date column with that value. Therefore, you'll have to use the EARLIER() function along with RANKX() and FILTER().
Use this DAX Formula:
Rank = RANKX(FILTER('Table','Table'[Date]=EARLIER('Table'[Date])&&'Table'[Name]=EARLIER('Table'[Name])),'Table'[Batch],,ASC,DENSE)
Here's the result:
Works for you? Mark this post as a solution if it does!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
78 | |
76 | |
53 | |
37 | |
31 |
User | Count |
---|---|
101 | |
56 | |
51 | |
45 | |
40 |