Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Add Conditional Columns In Power Query at Scale

Hi,

I'm looking for a way to add conditional columns in Power Query at scale. I found this article ( https://support.microsoft.com/en-us/office/add-a-conditional-column-power-query-f2422ed1-f565-4e64-b... ) that shows how to manually add a conditional column, but if I have say hundreds of these entries, it would be difficult to manage. Say I had a list with the values in one column and the outputs in the other. Is there a way to create conditional columns based off this list?

 

Here's an example:

Original Column                                 Column to be Added

Oceansea Ventures                             Ocean

Supersupply Logistics                         Shipper

 

Conditional Logic:

If A contains B then add C

If Oceansea Ventures contains Sea then add Ocean (non case sensitive)

If Supersupply Logistics contains Logistics add Shipper (non case sensitive)

 

Ideally, I would have a file that has bindings that Power Query can use. This file would be able to be continually updated. Example:

B > C

Sea > Ocean

Logistics > Shipper

 

Is there a way to accomplish this? Thanks in advance!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

 

It sounds you need a custom function to do SWITCH, put your reference in ref table, then call fnSwitch, file attached for your reference

Vera_33_0-1653962326953.png

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous 

 

It sounds you need a custom function to do SWITCH, put your reference in ref table, then call fnSwitch, file attached for your reference

Vera_33_0-1653962326953.png

 

Hi @Anonymous 

 

The solution looks great! I still have many to learn 😆

 

Best Regards,
Community Support Team _ Jing

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.