Forum Discussion
Dax Column creation based on latest date
- 3 years ago
hre the reference in the formula:
https://learn.microsoft.com/en-us/dax/datediff-function-dax
try somehting like this:
Column =
IF( DATEDIFF ( StartDate, EndDate, MONTH ) <= 1 , "Active",
IF( DATEDIFF ( StartDate, EndDate, MONTH ) <= 2, "2months ago",
IF( DATEDIFF ( StartDate, EndDate, MONTH ) <= 3, "3months ago",
IF( DATEDIFF ( StartDate, EndDate, MONTH ) < 12, "6months ago",
IF( DATEDIFF ( StartDate, EndDate, MONTH ) >= 12, "Inactive")))))
hre the reference in the formula:
https://learn.microsoft.com/en-us/dax/datediff-function-dax
try somehting like this:
Column =
IF( DATEDIFF ( StartDate, EndDate, MONTH ) <= 1 , "Active",
IF( DATEDIFF ( StartDate, EndDate, MONTH ) <= 2, "2months ago",
IF( DATEDIFF ( StartDate, EndDate, MONTH ) <= 3, "3months ago",
IF( DATEDIFF ( StartDate, EndDate, MONTH ) < 12, "6months ago",
IF( DATEDIFF ( StartDate, EndDate, MONTH ) >= 12, "Inactive")))))