+ Reply to Thread
Results 1 to 2 of 2

Power Query: Count # of matching values per column between two tables

  1. #1
    Registered User
    Join Date
    11-22-2019
    Location
    USA
    MS-Off Ver
    Office 2016
    Posts
    8

    Power Query: Count # of matching values per column between two tables

    Hello -

    I've spent hours and hours on this, but no luck. Can anyone help?

    Issue: I have two tables; one source data and one lookup data. I need to count the number of times the lookup data appears in the corresponding column on the main table. The column names could be anything, but they always have a counterpart in the other table.

    In the attached example, There are four columns (Month/Shape/Animal/Mineral) in the first table, and the same columns in the lookup table. The lookup table contains items that do not belong in the respective columns (i.e. "Triangle" is not a month, and "Kitten" is not a shape).

    I'm trying to use Power Query to count the number of invalid entries in each column:

    Input Data
    -Month- -Shape- -Animal- -Mineral-
    January Square Puppy Gold
    February Circle Kitten Quartz
    Square Triangle October Amber
    Circle Kitten October Lead
    Square Puppy Horse Gold
    Circle Puppy Goldfish Silver
    May Hexagon Pig Gold


    Invalid Values
    -Month- -Shape- -Animal- -Mineral-
    Square Kitten July Kitten
    Circle Puppy October Puppy
    Triangle Pig January Pig


    Trying to end-up with this table:
    Field Invalid Entry Count
    -Month- 4
    -Shape- 3
    -Animal- 2
    -Mineral- 0

    I have also attached a sample workbook. Any help/guidance/assistance would be ~greatly~ appreciated.

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Power Query: Count # of matching values per column between two tables

    Hi,

    Using your existing queries Raw_Data and Invalid_by_Field, a further query (refining your attempt Merge1):

    Please Login or Register  to view this content.
    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Add sheet name as a column in appended tables in Power Query
    By Glenn Kennedy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-20-2021, 03:05 PM
  2. [SOLVED] Power Query extract values from list column with nulls
    By Imbizile in forum Excel General
    Replies: 4
    Last Post: 02-04-2021, 10:00 AM
  3. [SOLVED] Power Query count occurrences of specific character in column
    By Imbizile in forum Excel General
    Replies: 4
    Last Post: 12-29-2020, 08:08 AM
  4. Replies: 10
    Last Post: 06-25-2020, 12:19 AM
  5. Power Query: Updating a query based on changing tables
    By cheesehead101 in forum Excel General
    Replies: 1
    Last Post: 12-16-2019, 06:54 PM
  6. Return closest value less than given number matching another column - Power Query ?
    By ChipsSlave in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-29-2017, 03:16 PM
  7. SQL Query to get count of matching & non-matching data from two tables
    By Kiran2012 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-13-2013, 10:32 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1