Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have a dataset similar to the below.
Supervisor | Area | Block |
Alan | 1 | 1A |
Marc | 2 | 1B |
Alan | 3 | 1C |
John | 4 | 1C |
Fred | 5 | 2 |
Fred | 5 | 4 |
I want to create a new column called 'Supervisor new' which copies over the data from supervisor but with the below condition.
If 'area' = '1' change 'Supervisor new' to "Alex"
If 'block' = '1b' or '1C' or '2" change 'Supervisor new' to "Dan"
Can anyone help me with the logic to achieve this?
Solved! Go to Solution.
you could edit the code in Advanced Editor. put the basic logic in using the Conditional Column functionality and then edit the code that is generated to add in any additional logic you need.
Try entering this into the box that comes up when you click "Custom Column"
if [Area] = 1 then "Alex" else
if [Block] = "1B" then "Dan" else
if [Block] = "1C" then "Dan" else
if [Block] = "2" then "Dan" else
[Supervisor]
In power query editor go to the Add Column tab and select Conditional Column. You can put your logic in there.
After playing around with the conditional column function, I do not see how this can be achieved due to the 'Else if' section not supporting 'and' statements.
Any ideas?
you could edit the code in Advanced Editor. put the basic logic in using the Conditional Column functionality and then edit the code that is generated to add in any additional logic you need.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
70 | |
68 | |
43 | |
34 | |
26 |
User | Count |
---|---|
86 | |
49 | |
45 | |
38 | |
37 |