Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Conditional Merge

ello i have a query wich i am working on and I need to merge it depending on the value of [ID RS] if its certain values then merge it with a table called CCunicos and the other [ID RS] with another t...
  • edhans's avatar
    edhans
    6 years ago

    That is a bit different than what I originally understood. I think a conditional merge is overcomplicating it.

     

    Just do two merges, then some if/then/else logic on nulls.

     

    See the attached file. This is in Excel because it was easier to get your tables loaded from a spreadsheet vs PBIs "Enter Data" screen.\

     

    The lower green table is what you want the result to be. See the queries in Power Query.

     

    I had to change the last record in your first table since you gave me all 71's in the ID RS field, which was a 100% match to the first table. I changed it to 93 and 300030001 for the ID_LOC field.