Two quaries have different data set but in one row some data is common, I need the complete data from both the queries

kashif khan 0 Reputation points
2024-06-21T07:40:24.8066667+00:00

I am trying through Power query but could not do it so far

I have two data sets

Table-1 it contains vehicle movement on particular dates User's image

and Table-2 it contains check points between two zipcodes User's image

now zip code is given in the first table as well. so that is the common column, next what i need is data by checkpoint name:

Result

User's image

Please help, thanks in advance

Office
Office
A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.
1,476 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,691 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Barry Schwarz 2,511 Reputation points
    2024-06-21T08:55:18.85+00:00

    It's easy enough to do in a macro.

    1. Loop through table 1
      1. Loop through table 2 till zip codes match
      2. Add record to output table for the checkpoint/car combination
        1. Go to next row in table 2
        2. If no zip code in row, go to step 1b
      3. Next table 1 row
    2. Sort output table by checkpoint and date (and maybe by car).
    0 comments No comments