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
Anonymous
Not applicable

Conditional Column : If then not working

Hello , 

 

I am doing very simple If then statement using Condition column and only getting others results for all the rows. Both the columns have dataset type "Text". 

IfThen.jpg

 Does anyone why it is happening?

 

 

 

7 REPLIES 7
Anonymous
Not applicable

In Excel, IF is a core function, it’s one of the first ones we learn. Last week, we looked at Functions in Power Query, but we didn’t cover a Power Query version of the IF function. Surely there is one… right? …well, kind of.

To use if logic in Power Query, we need a more programming based methodology rather than a function based methodology we find in Excel. If you’ve ever programmed VBA or other languages, you will be familiar with this approach. However, if you’re coming from a purely Excel world this may be new to you.

There are two options:

Using the conditional column feature for basic if logic
Writing M code for more advanced if logic.

 

Admin

Apps4rent | o365cloudexperts

nandukrishnavs
Community Champion
Community Champion

@Anonymous 

It could be due to additional whitespace in the cell.

Apply the trim function and then create the conditional column.

 

Capture.JPG

Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

Hi @nandukrishnavs

I used TRIM and then created the conditional column , it's still the same results. It returns only else value.

Hello @Lewis-H

Yes, I'm new to programming and practicing power bi with conditional column. I create a separate table for Join and Description, linked to the main table. I'm still not getting a response

Thank you

Anonymous
Not applicable

Hi @nandukrishnavs 

 

I used TRIM and then created the conditional Column , still same results. Only returns else value. 

 

Hi @Anonymous 

 

Yes I am new to the programining and practicing power bi with conditional column. I create seperate Table for Combination and Description , linked it to main table. I am still not getting answer

 

Thanks

Hi @Anonymous ,

 

Maybe it is caused by the order of conditions. Please move them up and down to have a try. 

 

Here is a blog about conditional column. Hope it can help you.

Conditional Column in Power BI using Power Query; You can do anything! 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Anonymous ,

 

Could you tell me if your problem has been solved? If it is, kindly mark the helpful answer as a solution if you feel that makes sense. Welcome to share your own solution. More people will benefit from the thread.

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@Anonymous 

 

You can achieve this by implementing a calculated column using simple nested if condition. 

Another method: Grouping https://docs.microsoft.com/en-us/power-bi/desktop-grouping-and-binning

 



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

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.