Forum Discussion
ruesaint_denis
Helper I
4 years agoRank by User Id, Date, with Filter
Hi everyone, I am looking to rank my Orders based on the USER ID (repeats) and DATE, but only for completed orders. I have this DAX for a calculated column, but as you can see, it isn't wor...
- 4 years ago
Rank CC =
VAR currentid = Orders[User Id]
VAR newtable =
FILTER ( Orders, Orders[User Id] = currentid && Orders[Status] = "COMPLETED" )
RETURN
IF (
Orders[Status] = "COMPLETED",
RANKX ( newtable, Orders[Completed At],, ASC )
)
Jihwan_Kim
Super User
4 years ago
Rank CC =
VAR currentid = Orders[User Id]
VAR newtable =
FILTER ( Orders, Orders[User Id] = currentid && Orders[Status] = "COMPLETED" )
RETURN
IF (
Orders[Status] = "COMPLETED",
RANKX ( newtable, Orders[Completed At],, ASC )
)
- ruesaint_denis4 years ago
Helper I
Jihwan_Kim thank you so much
- MarkyMark12 years ago
Advocate I
How can you get this to work if you have a tie with the dates. I.e the same dates under the same id and you need it to give a different rank based on the row order. I don't have access to the query editor for this table.