Forum Discussion

jamiers's avatar
jamiers
Icon for Helper I rankHelper I
4 years ago
Solved

Remove row if it matches row in another table

Hello All,

 

I have been searching this question, but I can't seem to get to the bottom of my solution.

 

If an item shows up in Table 1, I want it to be excluded in Table 2.

 

I have created a cell to match from Table 1 and Table 2.  In the end, when I pull up table 2, I want it to remove every row that shows up in the match cell in Table 1.

 

Table 1 - Has a field called "MatchCode"

Table 2 - Has a Field called "Code" - 

 

I want any row to be removed in table 2 where Code shows up in the Table 1 Match Code.

How would I do this in Power Query?

  • Insert this statement in GAP Promotions - Promotions Lis where Table 2 is !GAPCheck

     

    = Table.SelectRows(Source, each not List.Contains(List.Buffer(Table2[#"Mem#/GAP"]),[#"Mem#/GAP"] ))

     

     

5 Replies

  • Vijay_A_Verma's avatar
    Vijay_A_Verma
    Icon for Most Valuable Professional rankMost Valuable Professional

    Please post samples of Table1 and Table2 so that we can provide the solution.

    • jamiers's avatar
      jamiers
      Icon for Helper I rankHelper I

      Here is a link to a Excel Sheet with Table Data.

      Table Data

       

      If a row shows up in !GAPCheck [Mem#/GAP], I want to eliminate the row from GAP Promotions - Promotions Lis.

      • Vijay_A_Verma's avatar
        Vijay_A_Verma
        Icon for Most Valuable Professional rankMost Valuable Professional

        Insert this statement in GAP Promotions - Promotions Lis where Table 2 is !GAPCheck

         

        = Table.SelectRows(Source, each not List.Contains(List.Buffer(Table2[#"Mem#/GAP"]),[#"Mem#/GAP"] ))

         

         

  • wdx223_Daniel's avatar
    wdx223_Daniel
    Icon for Community Champion rankCommunity Champion

    NewStep=let a=List.Buffer(Table1[Match Code]) in Table.SelectRows(Table2,each not List.Contains(a,[Code]))