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

Replacing null values with values from another column

Hi, 

 

I'm wondering where I'm going wrong with this formula. The goal is to replace the null values in "Description.2.2" with the values in "Description.1". I'm getting no errors with this formula, but it doesn't do anything at all. I've tried putting "null" in quotes, as well as without. It makes no difference.

 

What am I missing here?

 

= Table.ReplaceValue(#"Added Prefix","null", each _[Description.2.2],Replacer.ReplaceText,{"Description.1"})

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

use the following queries

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTIyVorViVZKBDLBDGMYowzIKCpRio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Description.1 = _t, Description.2.2 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Description.1", type text}, {"Description.2.2", type text}}),
    #"Replaced Value" = Table.ReplaceValue(#"Changed Type","",each _[Description.1],Replacer.ReplaceValue,{"Description.2.2"})
in
    #"Replaced Value"

Capture23.JPG

Capture24.JPG

 
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Create a new conditional column and populate values from both columns based on condition.

 

= Table.AddColumn(#"Changed Type", "Description 3", each if [Description 2] = null then [Description 1] else [Description 2])

Description3.png

v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

use the following queries

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTIyVorViVZKBDLBDGMYowzIKCpRio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Description.1 = _t, Description.2.2 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Description.1", type text}, {"Description.2.2", type text}}),
    #"Replaced Value" = Table.ReplaceValue(#"Changed Type","",each _[Description.1],Replacer.ReplaceValue,{"Description.2.2"})
in
    #"Replaced Value"

Capture23.JPG

Capture24.JPG

 
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jthomson
Solution Sage
Solution Sage

Easiest just to make a new column using similar conditional logic, rather than amending an existing one

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.