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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Ronnie7
Helper II
Helper II

Conditional Column with values from 2 tables

Hello,

 

I need to create a conditional column in the query editor ( that is, before the data is being fed into the model), based on values from two tables.

 

I know that the conditional column is good for values from one tables.

What would be they way to do so for values from two different tables?

For example (if [table1.col_name] = "x"  and [table2.col_name]="y" then...

 

 

Thanks!

2 REPLIES 2
Sean
Community Champion
Community Champion

@Ronnie7

If you insist on doing this in the Query Editor I think you'll have to Merge the Queries

before you can compare the values - but we may have to check with @ImkeF about this???

 

Look here

http://www.excelguru.ca/blog/2015/12/16/merge-tables-using-outer-joins-in-power-query/

and also

http://www.excelguru.ca/blog/2015/12/23/merge-tables-using-inner-and-anti-joins-in-power-query/

 

Hope this helps! Smiley Happy

 

ImkeF
Community Champion
Community Champion

Agree with @Sean.

I think that @Ronnie7 's question has an unspoken implication in it: That the matching values from the 2 columns have a common row-indicator 🙂

Which is normally not the row-number, but a matching attribute-value.

So as we don't have a data-model in the query-editor where the filters propagate, we need to join the tables on their common attributes in order to return meaningful data.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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