Forum Discussion

WJ876400's avatar
WJ876400
Helper IV
3 years ago
Solved

Multiple If statement

Hi   I want to create the below table. I have created the date difference column but only want a number to appear under certain conditions. -   End date Status Date difference 01/12/2022 ...
  • Jihwan_Kim's avatar
    3 years ago

    Hi,

    Please check the below picture and the attached pbix file.

    It is for creating a new column.

     

     

    Date diff CC =
    VAR _today =
        TODAY ()
    RETURN
        SWITCH (
            TRUE (),
            Data[End date] < _today
                && Data[Status] = "Pause", BLANK (),
            Data[End date] < _today
                && Data[Status] = "Finished", BLANK (),
            Data[End date] > _today, BLANK (),
            Data[End date] < _today
                && Data[Status] = "Live", DATEDIFF ( Data[End date], _today, DAY )
        )