Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
RenataOGardner
Helper II
Helper II

New column

Hello guys,

 

I'm trying to create a column where a list of customer numbers is related to the customer name, but I can't add more than 3 argument for the function below. All the numbers below should give "John Lewis" as answer. Can anyone help me out? Cheers!

Capture_DAX_CondColumn.JPG

1 ACCEPTED SOLUTION

The syntax is wrong.   Replace that = with a ,

And check that the data type of [no_] is text.  If it is of number type then you don't need the quotes round the hardcoded values

View solution in original post

6 REPLIES 6
Greg_Deckler
Community Champion
Community Champion

You could use nested IF statements, but don't. Use SWITCH instead but I can't exactly tell what you are trying to do. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi,

 

What I'm trying to do is: Create a column with the name of the Custormer and add all the locations that are under this customer. The locations are coded by number so each number I want to call for the name of the customer. 

 

Thanks!

So something like:

 

Column =

  SWITCH('Table'[Column],

    "39062","John Lewis",

    "39063","John Lewis",

    <as many pairs as you want>

  )

 

 

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hiya, 

 

Thanks for helping me. Much appreciate it. 

Unfortunately, it doesn't like the SWITCH either. 

Capture_DAX Switch function error.JPG

The syntax is wrong.   Replace that = with a ,

And check that the data type of [no_] is text.  If it is of number type then you don't need the quotes round the hardcoded values

Thank you so much! 🙂

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.