Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

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

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi,


    It seems this will work:

     

    = IFERROR
    (DATEDIFF(
    table[column1],
    table[column2],
    DAY),
    BLANK())

5 Replies