Forum Discussion
clim2f88j
2 years agoFrequent Visitor
Index Column Based on ID and Date
Hello everyone, I need to add an index column based on consumers ID and date. Data: ID Date AAA 1/1/23 AAA 3/7/23 AAA 4/18/23 BBB 12/19/22 BBB 4/5/23 CCC 7/9/23 ...
Anonymous
2 years agoNot applicable
Hi clim2f88j ,
Please try like:
Index =
RANKX (
FILTER (
ALL ( 'Table'[ID], 'Table'[Date] ),
'Table'[ID] = EARLIER ( 'Table'[ID] )
),
'Table'[Date],
,
ASC,
Dense
)
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
clim2f88j
2 years agoFrequent Visitor
Thank you for helping me out but i get the following error with that DAX: EARLIER/EARLIEST refers to an earlier row context which doesn't exist.
In your example, the AAA ID with the 3/7/2023 date have the same index. I need them to be different.