Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
17 | |
9 | |
8 | |
7 | |
7 |