Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Everyone
I am trying to use a switch statement to include a column for team location, based on a team identifier integer.
Team Location = SWITCH(TRUE(),'Team Map'[Team Order]= 1||2||3||4,"London")
However my results are as follows:
I have ensured the format of [Team Order] is whole number. the boolean should return FALSE for any number not 1 - 4 so how come I am getting this result?
thanks
Solved! Go to Solution.
@Anonymous
Use the IN function
Team Location = SWITCH(TRUE(),'Table (2)'[Column1] IN {1,2,3,4},"London")
If you are satisfied with my answer, please mark it as a solution so others can easily find it.
Don't forget to give KUDOS ? to replies that help answer your questions
Subscribe to ExcelFort: Learn Power BI, Power Query and Excel
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Please try an expression like this instead
Team Location = SWITCH(TRUE(),'Team Map'[Team Order] in {1,2,3,4},"London")
You could also consider a Groups column if you have other Cities to assign to numbers.
https://exceleratorbi.com.au/grouping-in-power-bi-desktop-without-using-dax/
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@Anonymous
Use the IN function
Team Location = SWITCH(TRUE(),'Table (2)'[Column1] IN {1,2,3,4},"London")
If you are satisfied with my answer, please mark it as a solution so others can easily find it.
Don't forget to give KUDOS ? to replies that help answer your questions
Subscribe to ExcelFort: Learn Power BI, Power Query and Excel
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
you beauty. thanks that works great! solution accepted and kudos given
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |