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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Dicken
Post Prodigy
Post Prodigy

Power Query ; Table Replace Error problem


Hi, 
I have to questions regarding this,      one why doesn't Table.ReplaceErrors work and how can I make it work? 

 let
Source = #table(type table [A = text, B = text], {{"a", "b"}, {"a", "c"}, {"d", "f"}, {"c", "d"}}),
reclist = List.InsertRange(Table.ToRecords(Source), 2, {"", ""}),
totable = Table.FromRecords(reclist),
replace = Table.ReplaceErrorValues(totable, {{"A", ""}, {"B", ""}})
in
replace

Richard.

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

Hi @Dicken,

Thank you for reaching out to the Microsoft Fabric Forum community.

 

I’ve reproduced the scenario using your sample data and for your reference, I’m attaching the output screenshot and the .pbix file. Thanks, @dufoq3 for providing your insights.

 

let Source = #table(type table [A = text, B = text], {{"a", "b"}, {"a", "c"}, {"d", "f"}, {"c", "d"}}), reclist = List.InsertRange(Table.ToRecords(Source), 2, {"", ""}), Transformed = List.Transform(reclist, each if Value.Is(_, Record.Type) then _ else [A = null, B = null]), ToTbl = Table.FromRecords(Transformed, null, MissingField.UseNull), 

ReplaceNulls = Table.ReplaceValue(ToTbl, null, "", Replacer.ReplaceValue, {"A", "B"}) 
 

in ReplaceNulls 

 

vsaisraomsft_0-1742978865503.png

 

 

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

 

Thank you.

View solution in original post

3 REPLIES 3
v-saisrao-msft
Community Support
Community Support

Hi @Dicken,

Thank you for reaching out to the Microsoft Fabric Forum community.

 

I’ve reproduced the scenario using your sample data and for your reference, I’m attaching the output screenshot and the .pbix file. Thanks, @dufoq3 for providing your insights.

 

let Source = #table(type table [A = text, B = text], {{"a", "b"}, {"a", "c"}, {"d", "f"}, {"c", "d"}}), reclist = List.InsertRange(Table.ToRecords(Source), 2, {"", ""}), Transformed = List.Transform(reclist, each if Value.Is(_, Record.Type) then _ else [A = null, B = null]), ToTbl = Table.FromRecords(Transformed, null, MissingField.UseNull), 

ReplaceNulls = Table.ReplaceValue(ToTbl, null, "", Replacer.ReplaceValue, {"A", "B"}) 
 

in ReplaceNulls 

 

vsaisraomsft_0-1742978865503.png

 

 

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

 

Thank you.

Thanks, are either of you able to eplain why Table.Replace Errors does not reocognise what is an error,
and just replace them ? 

dufoq3
Community Champion
Community Champion

Hi @Dicken, check this:

 

let
    Source = #table(type table [A = text, B = text], {{"a", "b"}, {"a", "c"}, {"d", "f"}, {"c", "d"}}),
    reclist = List.InsertRange(Table.ToRecords(Source), 2, {"", ""}),
    Transformed = List.Transform(reclist, each if Value.Is(_, Record.Type) then _ else []),
    ToTbl = Table.FromRecords(Transformed, null, MissingField.UseNull)
in
    ToTbl

Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.