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
NeroX
Helper I
Helper I

Replace values to formula

Hello,

 

How can i use formula to "Replace values" ?

NeroX_0-1683798086963.png

I have column with dates and i want replace values "null" to formula "=TODAY()"

 

What can i do? 

 

Thank you.

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @NeroX ,

 

First, replace null with a date value:

BA_Pete_0-1683799489479.png

 

Then, in the formula bar, change the auto-generated code from this:

BA_Pete_2-1683799733427.png

 

...to this:

BA_Pete_3-1683799780334.png

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

4 REPLIES 4
BA_Pete
Super User
Super User

Hi @NeroX ,

 

First, replace null with a date value:

BA_Pete_0-1683799489479.png

 

Then, in the formula bar, change the auto-generated code from this:

BA_Pete_2-1683799733427.png

 

...to this:

BA_Pete_3-1683799780334.png

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Thank you both.

 

It is solved. 🙂

Sorry @BA_Pete our messages crossed each other

 

Your solution is better 🙂 glad to see it 🙂

Einomi
Helper V
Helper V

I would create a blank query, that will give me today's date and will rename this query DateNow

 

= Date.From(DateTime.LocalNow())

 

Then on your date replace the null values by any date, then tweak the M code as below

 

= Table.ReplaceValue(#"Type modifié",null,DateNow,Replacer.ReplaceValue,{"Date"})

 

And it should work

 Let us know

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.

Top Solution Authors