Forum Discussion
sfshariff
9 years agoNew Member
Difference between two date columns in Direct Query mode
Hi, I am trying to create a calculated column showing the difference between two date columns (duration, i.e number of days). However, DATEDIFF function is not supported in Direct Query mode. I a...
v-chuncz-msft
9 years agoCommunity Support
I cannot reproduce this issue. Please share us more detailed information about the data source.
Salvador
9 years agoResponsive Resident
Hi,
Try creating a column with this (You'll need to replace the column names to the ones you'll use):
Collections Delay =
SWITCH (
TRUE ();
Invoices[Collection Date] < Invoices[Overdue Date]; DATEDIFF ( Invoices[Collection Date];Invoices[Overdue Date]; DAY )* -1;
Invoices[Collection Date] > Invoices[Overdue Date]; DATEDIFF ( Invoices[Overdue Date]; Invoices[Collection Date]; DAY );
0)