Forum Discussion
Difference between two columns and finding the Average it
- 7 years ago
Hi Greg_Deckler
Calculated Column for DATEDIFF is throwing an error saying "Function DATEDIFF is not allowed as part of calculated Column DAX expressions on DirectQuery models.
So I tried the DATEDIFF with Measure and it's accepting only with aggregate function like MIN,MAX etc,like below
1.DAY DIFF = DATEDIFF(MIN('Table1'[LAST_UPDATED_DATE]),MIN('Table1'[CREATION_DATE]),DAY)2.AVG OF DAY = AVERAGEX('Table1','Table1'[DAY DIFF])It's working fine.Thank you so much for your timely support.
Well, you should be able to create a column:
DAY DIFF = DATEDIFF([LAST_UPDATED_DATE],[CREATION_DATE],DAY)
And then a measure:
Average of DAY DIFF = AVERAGEX('Table',[DAY DIFF])
Hi Greg_Deckler
Calculated Column for DATEDIFF is throwing an error saying "Function DATEDIFF is not allowed as part of calculated Column DAX expressions on DirectQuery models.
So I tried the DATEDIFF with Measure and it's accepting only with aggregate function like MIN,MAX etc,like below
- Greg_Deckler7 years ago
Community Champion
Glad you got it sorted out. Yeah, DirectQuery causes some issues with certain DAX functions.