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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
trang_000
New Member

Power Query | Error on merging 2 tables

Actual Case:

Table 1:

 - Original data:

PolNoTrannoIncDateExpDateEffDate
123451202412012024123120241201
123452202412012024123120241202
123453202412012025011520241203

 - Step 1: Add "Merged" column = PolNo+EffDate+Tranno

 - Step 2: Sort "Merged" desc

 - Step 3: Add "Merged.1" column = PolNo+IncDate

 - Step 4: Deduplicate "Merged.1"

 

Table 2:

- Original Data

PolNoEffDate
1234520241204

 

- Step 1: Merge Table 1 by PolNo

- Step 2: Expand Table1.IncDate and Table1.ExpDate

Actual Result

- Table1.ExpDate = 20241231

Expected Result:

- Table1.ExpDate = 20250115

3 REPLIES 3
Anonymous
Not applicable

Hi @trang_000 

Can you provide some more sample data, the sample data you provide is relatively small that can't restore the expected results you want.

 

Best Regards!

Yolo Zhu

lbendlin
Super User
Super User

What's your reason for sorting in step 2?

Which columns are you deduplicating by in step 4?  Note that Power Query "Remove Duplicates"  is more often than not doing something different than what you expect.

Thanks for your feedback.
- Step 2 - 4: to get transaction has the max EffDate and max Tranno. 
- Deduplicate means removing duplicate. I removed duplicate in column Merged.1 = PolNo + IncDate

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.