This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi all,
How do I created a calculated column using DAX for the below:
Team = IF 'Username' = 'Adam Thompson' THEN 'London'
etc...
I want a new column called team and each team depends on what the username is.
Or perhaps go back to the source of your data and add an extra column in that table.
But best avoid writing it in Power Query as it doesn't have an equivalent SWITCH statement.
Hi,
I would recommend that you create a new table and make a relationship to the orginal table.
Then you dont need to write any dax code.
/Adam
You can use if like
IF(table[Username] = "Adam Thompson","London" ,"ABC")
But in your case it is better to use switch
https://docs.microsoft.com/en-us/dax/switch-function-dax
https://community.powerbi.com/t5/Report-Server/How-to-use-the-CASE-statement-in-Power-BI/td-p/410864
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 40 | |
| 38 | |
| 31 | |
| 23 | |
| 15 |
| User | Count |
|---|---|
| 74 | |
| 58 | |
| 31 | |
| 31 | |
| 23 |