Forum Discussion
jambrose
9 years agoFrequent Visitor
Finding Phantom Errors
I'm importing data from a CSV file with minimal manipulation. Had a few errors converting "Inf/-Inf" to a decimal which I fixed by replacing the offenders with the appropriate "Infinity/-Infinity", ...
- 9 years ago
It's difficult to tell without your code / example data.
Just to illustrate: the following code:
let Source = {1..10}, #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error), #"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "Number"}}), #"Replaced Value" = Table.ReplaceValue(#"Renamed Columns",4,-1/0,Replacer.ReplaceValue,{"Number"}), #"Replaced Value1" = Table.ReplaceValue(#"Replaced Value",8,1/0,Replacer.ReplaceValue,{"Number"}), MyTable = Table.TransformColumnTypes(#"Replaced Value1",{{"Number", type number}}) in MyTableReturns, after loading in Power BI Desktop, without any errors reported:
MarcelBeug
9 years agoCommunity Champion
It's difficult to tell without your code / example data.
Just to illustrate: the following code:
let
Source = {1..10},
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "Number"}}),
#"Replaced Value" = Table.ReplaceValue(#"Renamed Columns",4,-1/0,Replacer.ReplaceValue,{"Number"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value",8,1/0,Replacer.ReplaceValue,{"Number"}),
MyTable = Table.TransformColumnTypes(#"Replaced Value1",{{"Number", type number}})
in
MyTableReturns, after loading in Power BI Desktop, without any errors reported:
jambrose
9 years agoFrequent Visitor
MarcelBeug - Ah perfect, this is what I was missing. I was trying to convert the literal text value "Infinity", and it wasn't getting there, but 1/0 is working. Thanks!