cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Champion
Community Champion

Re: Conditional Column with values from 2 tables

@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

 

Highlighted
Super User IV
Super User IV

Re: Conditional Column with values from 2 tables

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors