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,
I want to do a Rank function which is based on the columns TableName, Group and DateTime
So for the latest DateTime for each TableName that is in the Group I want that to be ranked as 1
e.g
TableName = Sales
Group = AreaA
DateTime = 03/04/2022 22:00:03
Rank = 1
Current Results
New Results with Ranks Column
Thanks
Solved! Go to Solution.
Rank =
VAR _name = 'Table'[TableName]
VAR _group = 'Table'[Group]
VAR _result =
RANKX(
FILTER(
ALL('Table'),
'Table'[TableName] = _name
&& 'Table'[Group] = _group
),
'Table'[DateTime],
,
DESC
)
RETURN
_result
Hi @AvPowerBI ,
Here a solution:
And here the DAX:
TomsRankColumn =
RANKX (
FILTER (
'Table',
'Table'[TableName] = EARLIER ( 'Table'[TableName] ) &&
'Table'[Group] = EARLIER ( 'Table'[Group] )
),
'Table'[DateTime],
, DESC
, DENSE
)Let me know if this works for you 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
| Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
| Also happily accepting Kudos 🙂 |
| Feel free to connect with me on LinkedIn! | |
| #proudtobeasuperuser | |
Hi @AvPowerBI ,
Here a solution:
And here the DAX:
TomsRankColumn =
RANKX (
FILTER (
'Table',
'Table'[TableName] = EARLIER ( 'Table'[TableName] ) &&
'Table'[Group] = EARLIER ( 'Table'[Group] )
),
'Table'[DateTime],
, DESC
, DENSE
)Let me know if this works for you 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
| Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
| Also happily accepting Kudos 🙂 |
| Feel free to connect with me on LinkedIn! | |
| #proudtobeasuperuser | |
Rank =
VAR _name = 'Table'[TableName]
VAR _group = 'Table'[Group]
VAR _result =
RANKX(
FILTER(
ALL('Table'),
'Table'[TableName] = _name
&& 'Table'[Group] = _group
),
'Table'[DateTime],
,
DESC
)
RETURN
_result
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 134 | |
| 96 | |
| 78 | |
| 67 | |
| 65 |