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.
Hi dear Community!
Seeking your help again.
I want to add next column, which case would be for instance: if Column named Branch equals 03 and 04 this should add Spain, and if equals 31, 34, 82,83, 85, 89, 40 then it should bring France, rest Unknown.
I have tried if / if(or (if(and - but it does not work as thoes function only allow a mazimum of 2 arguments, and as you can see I have several.
I have tried Switch as well.
I am quite new in Power Bi , so maybe somone can help me write thoes functions or if there are other options do do this task.
Thank you in advance.
Solved! Go to Solution.
@Anonymous
Please select branch number column and go to modeling tab and change the data type of Branchnumber from text to number
OR
Use value function
Hi @Anonymous
Not sure how exactly your data looks like but you can try this
Column = SWITCH(TRUE()
,'Table'[Branch] IN {3,4},"Spain"
,'Table'[Branch] IN {31, 34, 82,83, 85, 89, 40}, "France"
,"none")
If this does not solve your purpose please share some sample data.
Hi @Anonymous
I have applied the function, but i get an error: "Table constructor cannot have optional argument"
Bellow I include the full formula in case I am m issing something.
@Anonymous Please place inverted comma at right place
I guess this is beacuse there is an inverted comma in Spain.
@AnonymousStill same. Please see a screeshot.
@Anonymous Please remove the semicolon after 402 value
@AnonymousVery True!
Corrected but now I am getting different error ( and I have changed format- the Branch Number column is under text format).
@Anonymous
Please select branch number column and go to modeling tab and change the data type of Branchnumber from text to number
OR
Use value function
BINGO!! 🙂
Thanks a lot. I opted fot the last option.
Coffe from me 🍮
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 |
---|---|
10 | |
8 | |
8 | |
8 | |
6 |
User | Count |
---|---|
14 | |
12 | |
11 | |
9 | |
9 |