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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Hashiru
Helper I
Helper I

Replace Errors

Hi all,

if I want to set the error values in a numeric column to zero using the query editor, does the following line of code will solve the problem?

 

#"Replaced Errors" =Table.ReplaceErrorValues(#"Changed Type",{{"CustomerID",0}})

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

Hi @Hashiru ,

 

You code should be ok.

 

Capture.PNG

M code for your reference.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ddFLCoNAEIThu/TahVXj8wa5w+BCUExA3CXnT0jS0kLN9qc2H5Wz3dZ5eRwbrLLXvD9X2FRlu/8qvfJb/9vkNcXaeG1ibb22sXZeu1h7r32sg9ch1tHrGCvqk1Ff+pk1D9oHDYQWQhOhjdBIaCUKTGomCy9qJjWTmknNpGZSM6mZLDDThzm9AQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [RH = _t, Values = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"RH", type text}, {"Values", type text}}),
    gourp= Table.Group(#"Changed Type", {"Values"}, {{"RH", each """" & Text.Combine(List.Transform(_[NumberColumn], (x) => Number.ToText(x)), ",") & """", type text}}),
    #"Replaced Errors" = Table.ReplaceErrorValues(gourp, {{"RH", "0"}})
in
    #"Replaced Errors"
Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

1 REPLY 1
v-frfei-msft
Community Support
Community Support

Hi @Hashiru ,

 

You code should be ok.

 

Capture.PNG

M code for your reference.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ddFLCoNAEIThu/TahVXj8wa5w+BCUExA3CXnT0jS0kLN9qc2H5Wz3dZ5eRwbrLLXvD9X2FRlu/8qvfJb/9vkNcXaeG1ibb22sXZeu1h7r32sg9ch1tHrGCvqk1Ff+pk1D9oHDYQWQhOhjdBIaCUKTGomCy9qJjWTmknNpGZSM6mZLDDThzm9AQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [RH = _t, Values = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"RH", type text}, {"Values", type text}}),
    gourp= Table.Group(#"Changed Type", {"Values"}, {{"RH", each """" & Text.Combine(List.Transform(_[NumberColumn], (x) => Number.ToText(x)), ",") & """", type text}}),
    #"Replaced Errors" = Table.ReplaceErrorValues(gourp, {{"RH", "0"}})
in
    #"Replaced Errors"
Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Solution Authors
Top Kudoed Authors