Reply
Super User
Posts: 2,961
Registered: ‎06-24-2015

Re: AND IF in conditional column

Hi there

If you need this to be a column I would suggest making the changes in the Power Query Editor, where it is a lot easier to make the changes you require.
The reason being is that you can use functions like "contains" or looking for specific things.
Did I answer your question? Mark my post as a solution!
"Proud to be a Datanaut!"
Super User
Posts: 2,961
Registered: ‎06-24-2015

Re: AND IF in conditional column

Hi there

Will it have the individual number in the column?

If not if you could post some sample data of what the column currently looks like
Did I answer your question? Mark my post as a solution!
"Proud to be a Datanaut!"
Regular Visitor
Posts: 25
Registered: ‎06-11-2018

Re: AND IF in conditional column

@GilbertQ please see screen shot of the excel table below. The column in black is the one I have issues with. This column comes with a letter instead of those numbers. Let me know if you require more info
Example.PNG

Super User
Posts: 2,961
Registered: ‎06-24-2015

Re: AND IF in conditional column

Hi there

Thanks for the screenshot.

 

What you could do, is go into the Power Query Editor, click on Add Conditional Column from the Add Column Ribbon.

 

Then you can use the conditional logic in which you can put in your requirements as shown below.

 

image.png

Did I answer your question? Mark my post as a solution!
"Proud to be a Datanaut!"
Regular Visitor
Posts: 25
Registered: ‎06-11-2018

Re: AND IF in conditional column

@GilbertQ, YES, this solved the issue. I expect to ge to the calculations and hope everything goes well.

Thank you VERY much for your assistance on this

Regards

Rodrigo

Super User
Posts: 2,961
Registered: ‎06-24-2015

Re: AND IF in conditional column

Hi @RodrigoTXRA

 

Happy to assist and get it working for you.

Did I answer your question? Mark my post as a solution!
"Proud to be a Datanaut!"
Highlighted
Regular Visitor
Posts: 27
Registered: ‎08-13-2018

Re: AND IF in conditional column

What was the response to this. 

 

I have similar situation for a custom column, i need to have values

 

if col1=a1 and col2 =a2 then '50' 

else col1=b1 and col2=b2 then 100 

 

and so on for 20 values

 

how to resolve this

Super User
Posts: 2,961
Registered: ‎06-24-2015

Re: AND IF in conditional column

Hi @ronakvi14

 

You can create a new Custom Column in the Power Query Editor with the following syntax

 

if [col1] = "a1" and [col2] = "a2" then 50
else if [col1] = "b1" and [col2] = "b2" then 100
else if [col1] = "c1" and [col2] = "c2" then 200
else 999
Did I answer your question? Mark my post as a solution!
"Proud to be a Datanaut!"
Regular Visitor
Posts: 25
Registered: ‎06-11-2018

Re: AND IF in conditional column

Please see content from @gilbertiq, that would suit your needs
New Member
Posts: 1
Registered: ‎11-16-2018

Re: AND IF in conditional column

Thanks. This was exactly what I needed and super helpful. Do you know of any sites where the general language for Power BI Power Query Editor is described?