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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
ThenNumbersGuy
New Member

How to replace null values in a column from another column

I have a few null values in column A " Month (End Date)" and Column B ("Year (End Date)" that I want to replace with values from Column C (Month ("Approved Date)") and Column D ("Year (Approved Date)"). In excel I just need to do a =formula and done but not sure how to code it in DAX to do this. Does anyone know the answer?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You can do this in Power Query pretty easily by adding a custom column with the following code:

if
Month[End Date] = null then
Month [Approved Date] 
else
Month [End Date]

This will create a column that has no nulls and either the Month Approved Date or the Month End Date. You then can remove both the End Date and Approved date columns if you want.  

 

Just repeat for the Year End column

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

You can do this in Power Query pretty easily by adding a custom column with the following code:

if
Month[End Date] = null then
Month [Approved Date] 
else
Month [End Date]

This will create a column that has no nulls and either the Month Approved Date or the Month End Date. You then can remove both the End Date and Approved date columns if you want.  

 

Just repeat for the Year End column

Hi,

 

Is there a solution for this same formula, but for direct query?

 

Many thanks

 

 

Thank you so much! I have wasted hours trying to find the solution.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.