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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
keen
Frequent Visitor

Replace null date with date data from another column

Hi Team , 

 

This is BI power query,

I am looking for a solution , need formula to replace "null " to date promised data if original promise date is null or no information. 

I am trying the add column> conditional column , but it does'nt t work , error.

keen_1-1700747676687.png

Regards, Keen

1 ACCEPTED SOLUTION

if my code solved your problem, accept it as a solution

View solution in original post

3 REPLIES 3
keen
Frequent Visitor

@Ahmedx  thanks for your sharing, the code is very helpful 🙂

if my code solved your problem, accept it as a solution

Ahmedx
Super User
Super User

pls try this code

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Zc7JDcAgDATAXvxGyAfhqAXRfxsQ8Yg3lvxhZ20xJ7HkM8pqlIh7Zr2PlY6pt4FmzoTRijdBe5zdpIak+f2C+z20h29XaL8f+6yhyf+SaEgMkrUB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Date Promised" = _t, #"Original Promise Date" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date Promised", type date}, {"Original Promise Date", type date}}),
    #"Replaced Value" = Table.ReplaceValue(#"Changed Type",null, (x)=>x[Date Promised], (x,y,z)=>  if x = null then z else x,{"Date Promised","Original Promise Date"})
in
    #"Replaced Value"

Screenshot_4.pngScreenshot_5.png

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.