Forum Discussion

bernate's avatar
bernate
Helper III
2 years ago
Solved

Get 2nd Result from Merge Queries

Hello, I am using Merge Queries in Power BI as a VLOOKUP to get the resulting row value based on the columns I am matching on. Table 1 contains the names of people, Table 2 contains the names and the...
  • Anonymous's avatar
    Anonymous
    2 years ago

    I would do it like this:

     

    let
    Source = Table.NestedJoin(Table1, {"Name"}, Table2, {"Name"}, "Table2", JoinKind.LeftOuter),
    #"Added Custom" = Table.AddColumn(Source, "Department 1", each [Table2]{0}[Department]),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Department 2", each try [Table2]{1}[Department] otherwise null),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom1",{"Table2"})
    in
    #"Removed Columns"

     

     

     

    --Nate