Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
LarryAlx
Frequent Visitor

Max or First Record when doing a Merge

I am doing a some table merging.  However, I do not need all the records from the second table, I only need the first record or the max depending on the scenario.  Can Merge accomplish this? If so what additional steps do I need to do before, during or after the merge? If there is a better solution than a Merge, please provide it.

 

Below is an example:

LarryAlx_6-1629132879951.png

LarryAlx_7-1629132889556.png

 

 

LarryAlx_8-1629132913187.png

 

 

 

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi  @LarryAlx ,

 

While merging,select "left outer" as the Join Kind:

vkellymsft_0-1629787672353.png

After that,go to append table and choose "Aggregate">select "Maximun" or "Minimum" of column "Contract Line Item":

vkellymsft_1-1629787745704.png

And you will see:

vkellymsft_2-1629787828566.png

For the related .pbix file,pls see attached.

 

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

 

 

View solution in original post

3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hi  @LarryAlx ,

 

While merging,select "left outer" as the Join Kind:

vkellymsft_0-1629787672353.png

After that,go to append table and choose "Aggregate">select "Maximun" or "Minimum" of column "Contract Line Item":

vkellymsft_1-1629787745704.png

And you will see:

vkellymsft_2-1629787828566.png

For the related .pbix file,pls see attached.

 

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

 

 

mahoneypat
Microsoft Employee
Microsoft Employee

I would do a Group By on the ID column on your Right Table, choosing Max as the aggregation on the line item column.  You can then merge either table into the other.

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


tctrout
Responsive Resident
Responsive Resident

Instead of merging, try Group By.  The default GUI interface provides options to Group By Max or Group by Min.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.