cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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

Accepted Solutions
Highlighted
Super User I
Super User I

Re: New column

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
Highlighted
Super User IV
Super User IV

Re: New column

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


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Frequent Visitor

Re: New column

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!

Highlighted
Super User IV
Super User IV

Re: New column

So something like:

 

Column =

  SWITCH('Table'[Column],

    "39062","John Lewis",

    "39063","John Lewis",

    <as many pairs as you want>

  )

 

 

 


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Frequent Visitor

Re: New column

Hiya, 

 

Thanks for helping me. Much appreciate it. 

Unfortunately, it doesn't like the SWITCH either. 

Capture_DAX Switch function error.JPG

Highlighted
Super User I
Super User I

Re: New column

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

Highlighted
Frequent Visitor

Re: New column

Thank you so much! 🙂

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors