March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello,
I have excel with Salesman:
and I need to add a region to the salesman but no in excel.
I want add regions to the salesman in Data wiew.
What can i do? Any ideas?
PS: i can't use the query editor because excel will always be uploaded new and my column would be canceled, but when i create it in data wiev it stays there.
Thank you. 🙂
Solved! Go to Solution.
Hi @NeroX ,
Query Editor in Power BI will work fine. It will add the custom column after the new Excel has been imported each time. Either way, you want to create a conditional column:
In Power Query:
if List.Contains( {"aadamek", "adomanski"}, [Salesman] ) then "CEE"
else if List.Contains( {"adous", "jim", "jane"}, [Salesman] ) then "GER"
else if ...
...
else // your escape value here e.g. null, "No Region" etc.
In DAX:
SWITCH(
TRUE(),
yourTable[Salesman] IN {"aadamek", "adomanski"}, "CEE",
yourTable[Salesman] IN {"adous", "jim", "jane"}, "GER",
...,
...,
// your escape value here e.g. "No Region" etc.
// you can ignore this last argument if you want the escape to be BLANK()
)
Pete
Proud to be a Datanaut!
Hi @NeroX ,
Query Editor in Power BI will work fine. It will add the custom column after the new Excel has been imported each time. Either way, you want to create a conditional column:
In Power Query:
if List.Contains( {"aadamek", "adomanski"}, [Salesman] ) then "CEE"
else if List.Contains( {"adous", "jim", "jane"}, [Salesman] ) then "GER"
else if ...
...
else // your escape value here e.g. null, "No Region" etc.
In DAX:
SWITCH(
TRUE(),
yourTable[Salesman] IN {"aadamek", "adomanski"}, "CEE",
yourTable[Salesman] IN {"adous", "jim", "jane"}, "GER",
...,
...,
// your escape value here e.g. "No Region" etc.
// you can ignore this last argument if you want the escape to be BLANK()
)
Pete
Proud to be a Datanaut!
niceee, thank you. I used in power query. But correct is:
------------------------------------------------------------------------------------
else if List.Contains( {"adous", "dperret", "fdidierjean", "rtimmers"}, [Salesman] ) then "CH"
------------------------------------------------------------------------------------
chatGPT helped me little bit.
Thank you.
Ah yes, silly mistake.
I've updated my post for the benefit of future readers.
Pete
Proud to be a Datanaut!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
16 | |
13 | |
12 | |
9 |
User | Count |
---|---|
36 | |
31 | |
20 | |
19 | |
17 |