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 in Power BI by MeghaSree
• 130 points
39 views

2 answers to this question.

0 votes

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 by anonymous
• 27,960 points
0 votes
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 by anonymous
• 27,960 points

Related Questions In Power BI

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 in Power BI by Upasana
• 8,530 points
68 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 10 in Power BI by Avantika
• 1,500 points
249 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 2 in Power BI by Avantika
• 1,500 points
123 views
0 votes
1 answer

Unable to install connector for Power Bi and PostgreSQL

I think the problem is not at ...READ MORE

answered Aug 21, 2018 in Power BI by nirvana
• 3,060 points
692 views
0 votes
1 answer

Connect power bi desktop to dataset and create custom reports

Yes using Power BI REST API to ...READ MORE

answered Sep 18, 2018 in Power BI by Kalgi
• 41,470 points
123 views
0 votes
1 answer

Is there a way to convert JSON data to readable table in power bi

Follow these steps step 1 - Click on ...READ MORE

answered Sep 24, 2018 in Power BI by Hannah
• 15,220 points
2,546 views
0 votes
1 answer

Power BI in use cases

Power is BI is used for gathering ...READ MORE

answered Sep 27, 2018 in Power BI by Kalgi
• 41,470 points
20 views
0 votes
2 answers

Power BI Dax Multiple IF AND Statements

HI I have Column Patient 12 13 14 15 18 IN Patient=12, 13 Out ...READ MORE

answered May 22 in Power BI by VNK
8,220 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 in Power BI by Cherukuri
• 27,960 points
1,498 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 9 in Power BI by anonymous
• 27,960 points
39 views