Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |