Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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 2
v-yalanwu-msft
Community Support
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.

SpartaBI
Community Champion
Community Champion

@Anonymous 
If you have blank rows in your date table than this is not a proper date table and you won't be able use time intelligence with it. You need to clean your data before you bring it to the model.

Check this for a good reference for a simple date table:
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.