Forum Discussion

Stinkin_linkin's avatar
Stinkin_linkin
New Member
3 years ago
Solved

Merging tables based on condition

Hi everyone, I have an input table with a 0 or 1 for each category, as follows:   Input | Category 1 | Case1 1 | Case2 0 | Case3 0 | Case4 1 | Case5   There are separate tables associated w...
  • Stinkin_linkin's avatar
    Stinkin_linkin
    3 years ago

    I couldn't get this method to work, but I did find another solution. First I filter out the zeros from my input table, then I converted my input table into a list, and then did a "filter by list" function in my merge query. Note: my merge query loads all the tables by default, and then filters out the tables that weren't selected by the user.

     

    The code that filters by list looks like this:

    = Table.SelectRows(#"Removed Columns", each (List.Contains(#"User selection",[Group]) =true ))

     

    Note: Some of the labels might be confusing without seeing the whole code


    Here's a youtube link to video that helped! Hopefully it's okay to post this here?

    Power Query - Filtering By a List - YouTube