Forum Discussion
Anonymous
3 years agoNot applicable
Need Help
Hi all, I need help to write a measure comparing two date fields ('GL post date' and 'Original Invoice Date') in same table (Sales Fact). I had written following code to calculate date difference w...
Sahir_Maharaj
3 years agoSuper User
Here's an alternate approach that you can use to calculate the date difference for each row in the 'Sales Fact' table:
AGE =
VAR DateDiff = DATEDIFF('Sales Fact'[GL Post Date], 'Sales Fact'[Original Invoice Date], DAY)
RETURN SUMX(VALUES('Sales Fact'[Row]), DateDiff)