Forum Discussion
Anonymous
8 years agoNot applicable
Encoding numbers to text
Hello, I have a unique situation where most of my values are coming in as their actual text value, but some are being decoded as a numeric value. For example, 12345 would be encoded as MTIz...
- 8 years ago
Hi Anonymous
In power query, set the data type of the "value" column to be "any".
Best Regards
Maggie
v-juanli-msft
8 years agoCommunity Support
Hi Anonymous
Here are two options for your reference
First create a custom column
Custom=Value.Is([value],Int64.Type)
- add a conditional column
Corresponding M query:
= Table.AddColumn(#"Added Custom", "Custom.1", each if [Custom] = true then "Basically" else [value])
- Replace values on original column directly.
= Table.ReplaceValue( #"Added Custom" ,each [value],each if [Custom] = true then "Basically" else [value],Replacer.ReplaceValue,{"value"})
Best regards,
Maggie
Anonymous
8 years agoNot applicable
Hi Maggie,
Thank you very much. I will try these solutions and will let you know how I make out.
Regards,
Pete
- Anonymous8 years agoNot applicable
When I tried the above solution, the values within my custom column are all set to FALSE, even the numeric values.
- v-juanli-msft8 years agoCommunity Support
Hi Anonymous
In power query, set the data type of the "value" column to be "any".
Best Regards
Maggie
- Anonymous8 years agoNot applicable
Anonymous https://www.thebiccountant.com/2016/05/22/multiple-replacements-in-power-bi-and-power-query/