Forum Discussion
Anonymous
5 years agoNot applicable
Power Query Editor: Calcualte Date difference (some columns blank)
Hi,
How would in DAX calculate the number of days between 2 date columns
- Column1 (format: date): 17-11-2016
- Column2 (format: date): 19-11-2016
Wanted outcome (format: whole number): 2
Note: some Colum2 will be blank - here I would like a blank cell as outcome as well
- Anonymous5 years ago
Hi,
It seems this will work:= IFERROR (DATEDIFF( table[column1], table[column2], DAY), BLANK())
5 Replies
- amitchandakSuper User
Anonymous ,
Power Query
Duration.Days(Duration.From([Column2]-[Column1])))
In DAX
Try new column
Datediff([column1],[column2],day)
- AnonymousNot applicable
Wont work,
I alsso tried:
DATEDIFF MIN( table[column1]), MAX( table[column2]), DAY)- amitchandakSuper User
Anonymous , That is the measure .Hope your date setting is correct
Can you share a sample pbix after removing sensitive data.