Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

DAX for empty date column

Hi, 

 

I have a data set with a date column (DD.MM.YYYY), a year column and a quarter column. 

I want to primarily use the date column for time intelligence. However, some rows in the date column are empty. The year (i.e. 2022) and quarter (i.e. 1,2 etc) columns always have data. 

 

Therefore, I want to link to year and quarter columns in the instance where the date columns are empty, to create an artifical date (i.e. 31.03.2022 for Q1, 2022) .

I was considering doing this via an IF Statement with multiple conditions? What do you suggest?

 

Thank you for your help!

2 Replies

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    Hi, Anonymous ;

    To create a new column, use:

    column = IF ([Date] = blank (), the Date (2022,3,31), [Date])


    If you have a lot of conditions, you can also use switch.


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.