Forum Discussion
M_SBS_6
1 year agoHelper V
Latest Date by Column Value
Hi, I have several columns in my table and I'd like to flag a 1 or 0 in another column based on the latest date by product. Any idea how to do this please? ID. Date. Product. Fl...
- 1 year ago
M_SBS_6 Create a calculated column using the below DAX
Flag = var maxdate = CALCULATE(MAX(MyTable[Date]) , ALLEXCEPT(MyTable,MyTable[Product])) RETURN IF( MyTable[Date] = maxdate , 1 , 0 )Output:
Did I answer your question ? If yes, please mark my post as a solution.
Thanks,
Jai
- 1 year ago
New column:
Flag =
VAR LatestDate =
CALCULATE(
MAX('Table'[Date]),
FILTER(
'Table',
'Table'[Product] = EARLIER('Table'[Product])
)
)
RETURN
IF('Table'[Date] = LatestDate, 1, 0)💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
Jai-Rathinavel
1 year agoSuper User
M_SBS_6 Create a calculated column using the below DAX
Flag =
var maxdate = CALCULATE(MAX(MyTable[Date]) , ALLEXCEPT(MyTable,MyTable[Product]))
RETURN
IF( MyTable[Date] = maxdate , 1 , 0 )
Output:
Did I answer your question ? If yes, please mark my post as a solution.
Thanks,
Jai