Forum Discussion
DATEDIFF error when used with multiple columns in CALCULATE()
- 8 years ago
Hi team,
I got the solution.
I eventually added a calculated column to the Fact_DO_PF table. I used DateDiff in the calculated column to find different between the two dates in day with dax shown below:
LastDEPInDays = DATEDIFF(DATE(LEFT(Fact_DO_PF[LastDEP_DateKey],4),MID(Fact_DO_PF[LastDEP_DateKey],5,2),RIGHT(Fact_DO_PF[LastDEP_DateKey],2)),RELATED(Dim_Date[dDate]),DAY)
and I used the column to filter my measure.
NoTransaction = CALCULATE(COUNT(Fact_DO_PF[AccountKey]),Fact_DO_PF[LastDEPInDays]>90)
Thanks to all
Hi team,
I got the solution.
I eventually added a calculated column to the Fact_DO_PF table. I used DateDiff in the calculated column to find different between the two dates in day with dax shown below:
LastDEPInDays = DATEDIFF(DATE(LEFT(Fact_DO_PF[LastDEP_DateKey],4),MID(Fact_DO_PF[LastDEP_DateKey],5,2),RIGHT(Fact_DO_PF[LastDEP_DateKey],2)),RELATED(Dim_Date[dDate]),DAY)
and I used the column to filter my measure.
NoTransaction = CALCULATE(COUNT(Fact_DO_PF[AccountKey]),Fact_DO_PF[LastDEPInDays]>90)
Thanks to all