Forum Discussion
dmurali1829
4 years agoRegular Visitor
Calculate Date diff based on selected category
Hi In the below table i want to calculate date difference keeping one category in Day as 0, in this case Day 0 as 0 and it should considering for substrating other dates eiher + or -, i will be h...
- 4 years ago
Hi dmurali1829
You can create a column with below DAX.
Date Diff = VAR _day0 = MAXX ( FILTER ( TableName, TableName[ID] = EARLIER ( TableName[ID] ) && TableName[Day] = "Day 0" ), TableName[Date] ) RETURN DATEDIFF ( _day0, TableName[Date], DAY )Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
v-jingzhang
Community Support
4 years agoHi dmurali1829
You can create a column with below DAX.
Date Diff =
VAR _day0 =
MAXX (
FILTER (
TableName,
TableName[ID] = EARLIER ( TableName[ID] )
&& TableName[Day] = "Day 0"
),
TableName[Date]
)
RETURN
DATEDIFF ( _day0, TableName[Date], DAY )
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.