Forum Discussion
Data Wranglig with the Query Editor
- 8 years ago
In your scenario, you have thousands company names. And maybe one same company will have several different names. So you want to format these different names into a same one. Right?
First, you should know that in Power Bi, if you want to change the Upper/Lower cases. You just need to go to Query Edit -> Transform -> Format.
Then to achieve your requirement, I’m afraid first you have to make a mapping list manually then do the format. To do this, I would suggest you to use Power Query. Please refer:
Go to Query Edit in Power BI desktop - > Right Click your source table and go to Advanced Edit - > define a mapping function like below:
let fnChoose_CustCode = (input) => let values = { {"MUEB", "Muebles LTDA"}, {"AAAA", "AAAA"}, {input,"Undefined"} }, Result = List.First(List.Select(values, each _{0}=input)){1} in Result, Source = …Then create a new Custom Column, and specify it with expression like: = fnChoose_CustCode(Text.Range([Orignal Name],0,4)).
Reference: https://www.excelguru.ca/blog/2014/09/03/multi-condition-logic-in-power-query/
Thanks,
Xi Jin.
In your scenario, you have thousands company names. And maybe one same company will have several different names. So you want to format these different names into a same one. Right?
First, you should know that in Power Bi, if you want to change the Upper/Lower cases. You just need to go to Query Edit -> Transform -> Format.
Then to achieve your requirement, I’m afraid first you have to make a mapping list manually then do the format. To do this, I would suggest you to use Power Query. Please refer:
Go to Query Edit in Power BI desktop - > Right Click your source table and go to Advanced Edit - > define a mapping function like below:
let
fnChoose_CustCode = (input) => let
values = {
{"MUEB", "Muebles LTDA"},
{"AAAA", "AAAA"},
{input,"Undefined"}
},
Result = List.First(List.Select(values, each _{0}=input)){1}
in
Result,
Source = …Then create a new Custom Column, and specify it with expression like: = fnChoose_CustCode(Text.Range([Orignal Name],0,4)).
Reference: https://www.excelguru.ca/blog/2014/09/03/multi-condition-logic-in-power-query/
Thanks,
Xi Jin.
Thank you v-xjiin-msft