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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
PowerBINoob24
Resolver I
Resolver I

Replace null in a column with date from another column on the same row

Again, something that seems like it should be pretty straightforward for me, but it's not.  I have a column "Created date" in my PBI table.  There is another column "Original Date" in the table.  Some of the rows have "null" in the Original Date column.  I need to copy over the "Created Date" from the same row when the "Original Date" shows "null.  

 

I tried replace value in power query, but that doesn't work for what I'm trying to do. Any thoguhts on how I can get this done?

 

TIA

1 ACCEPTED SOLUTION
PowerBINoob24
Resolver I
Resolver I

Hello all.  Thank you for the responses.  I needed to use the existing column, so I couldn't use any suggestions that created a new column.  Eventually what I did was manually entered a step in the applied steps in PQ.  = Table.ReplaceValue(#"Reordered Columns",null,each [Created],Replacer.ReplaceValue,{"Original Date"})  That resolved my issue.  Thank you all for your help!

View solution in original post

7 REPLIES 7
PowerBINoob24
Resolver I
Resolver I

Hello all.  Thank you for the responses.  I needed to use the existing column, so I couldn't use any suggestions that created a new column.  Eventually what I did was manually entered a step in the applied steps in PQ.  = Table.ReplaceValue(#"Reordered Columns",null,each [Created],Replacer.ReplaceValue,{"Original Date"})  That resolved my issue.  Thank you all for your help!

v-dineshya
Community Support
Community Support

Hi @PowerBINoob24 ,

Thank you for reaching out to the Microsoft Community Forum.

 

Hi @ryan_mayu , @MasonMA . @Abhilash_P , @Ashish_Mathur , @danextian Thank you for your prompt response.

 

Hi @PowerBINoob24 , If  @ryan_mayu , @MasonMA . @Abhilash_P , @Ashish_Mathur , @danextian  Response has resolved your issue. Please mark their response as "Accept as solution",  to assist other community members in resolving similar issues more efficiently.

Regards,

Dinesh

danextian
Super User
Super User

Hi @PowerBINoob24 

In the query editor you can do this:

[Colum1] ?? [Column2]

The DAX equivalent would be

COALESCE ( 'table'[Colum1], 'table'[Column2] )

Both checks whether the first column is blank/null then return the second column else the first column.

Note: should be null or blank. Power BI treats a white space differentently.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Ashish_Mathur
Super User
Super User

Hi,

You can also write this calculated column formula in DAX

=if(Data[Original data])=blank(),Data[Created date],Data[Original data])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Abhilash_P
Continued Contributor
Continued Contributor

Hi @PowerBINoob24 ,
You can create a new column in both power query and PBI Desktop

Below is the code for creating in power query

[Original Date] = null then [Created Date] else [Original Date]



Below is the code for creating in PBI desktop using DAX

Final Date = 
IF(
    ISBLANK('Table'[Original Date]), 
    'Table'[Created Date], 
    'Table'[Original Date]
)
MasonMA
Impactful Individual
Impactful Individual

@PowerBINoob24 

 

Hi, the simpler way would be add one Custom Column with below M, and then remove your 'OriginalDate'

if [OriginalDate] = null then [CreatedDate] else [OriginalDate]

 

MasonMA_0-1752716088243.png

Hope it works:) 

ryan_mayu
Super User
Super User

@PowerBINoob24 

 

you can try to create a new column in PQ

 

=if [Original Date] is null then [Created Date] else [Original Date]

 

11.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.