If and Else Statement to use in operator

+1 vote
Hello,

How do I use the If and else statement in Custom Column in Power BI either with similar SQL statement or DAX. I tried looking online but always I see the examples of True or False but not with such in operator and grouped.

If ([Product] in ('ABC', 'DEF', 'GHI') then ('XYZ') Else  ('UVW')
Aug 29, 2019 in Power BI by MeghaSree
• 130 points
500 views

2 answers to this question.

+1 vote

Hi, MeghaSree

You can use conditional column instead of a custom column.

It is similar as a custom column and easier to provide the if-else condition.

Click on the conditional column and write condition for each value in the ('ABC', 'DEF', 'GHI') in the value box and else separately.

For example.

Hope it helps!

answered Aug 29, 2019 by anonymous
• 33,030 points
+1 vote
Hey @Megha.

I am new to Power BI so I'm not sure of the solution, but you can try below way.

Use a dax expression to rename the column values using condition on True or false to  'XYZ' or 'UVW' after using a custom function. Maybe it will help.
answered Aug 29, 2019 by anonymous
• 33,030 points

Related Questions In Power BI

0 votes
1 answer

How to Create and use doughnut charts in Power BI?

Hey, To create a doughnut chart in Power ...READ MORE

answered Feb 6, 2020 in Power BI by Gitika
• 65,910 points
806 views
0 votes
1 answer

How to Transpose unique values and get matching values in rows?

I think this query should do what ...READ MORE

answered Apr 1, 2019 in Power BI by Upasana
• 8,620 points
1,332 views
0 votes
1 answer

How to use Python Scripts in Query Editor?

Hi, In order to use Python Visuals you need ...READ MORE

answered Apr 11, 2019 in Power BI by Avantika
• 1,520 points
3,355 views
0 votes
1 answer

How To use R Integration in Power BI?

Hi,  There are a lot of packages available ...READ MORE

answered May 3, 2019 in Power BI by Avantika
• 1,520 points
2,323 views
0 votes
1 answer

How to show visualization (map) based on latitude and longitude points in power BI?

Follow the below steps: 1. Select the map ...READ MORE

answered Oct 18, 2019 in Power BI by anonymous
• 3,450 points
2,711 views
0 votes
1 answer

How to use a gateway in Power Bi?

Follow the below procedure - 1. Install ...READ MORE

answered Oct 29, 2019 in Power BI by rachael
714 views
0 votes
1 answer

How to use play axis in stocked column chart

Hey Katyvin, If you want to use the ...READ MORE

answered Feb 18, 2020 in Power BI by Gitika
• 65,910 points
2,074 views
0 votes
0 answers

If invoice date is <= OTD then OT else Late and if OTD is blank then OT

I am getting an error message. I ...READ MORE

Jun 30, 2020 in Power BI by lcallicutt
• 120 points
695 views
0 votes
1 answer

How to calculate cumulative Total and % in DAX?

Hi, If your table is ready with percentage ...READ MORE

answered Mar 18, 2019 in Power BI by Cherukuri
• 33,030 points
18,352 views
0 votes
1 answer

How to categorize state, pin and city in power bi (Address)

After loading dataset, you can split in ...READ MORE

answered May 10, 2019 in Power BI by anonymous
• 33,030 points
2,954 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP