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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
dedelman_clng
Community Champion
Community Champion

Merge queries causing duplicate records

I am merging two queries together and it is creating duplicate records in the output. I have verified that there are no duplicates in either of the base queries as shown below

 

Table "States"

Valvetimestampstring_valuenameIndexTS-MSDt
XV0170452025-08-04T00:03:26.0110015-05:00UNDEFINEDPV_D194008/4/2025 12:03:26.0118/4/2025
XV0170452025-08-04T00:03:27.0070037-05:00CLOSEDPV_D194018/4/2025 12:03:27.0078/4/2025
XV0170452025-08-04T08:03:27.0070037-05:00CLOSEDPV_D194038/4/2025 08:03:27.0078/4/2025
XV0170452025-08-04T11:23:27.0070037-05:00CLOSEDPV_D194058/4/2025 11:23:27.0078/4/2025
XV0170452025-08-04T11:33:27.0070037-05:00CLOSEDPV_D194068/4/2025 11:33:27.0078/4/2025
XV0170452025-08-04T12:03:27.0070037-05:00CLOSEDPV_D194098/4/2025 12:03:27.0078/4/2025
XV0170452025-08-04T12:10:03.5070037-05:00OPENPV_D194118/4/2025 12:10:03.5078/4/2025
XV0170452025-08-04T12:50:58.5070037-05:00CLOSEDPV_D194138/4/2025 12:50:58.5078/4/2025
XV0170452025-08-04T20:50:58.5070037-05:00CLOSEDPV_D194158/4/2025 08:50:58.5078/4/2025

 

Table "RS Samples"

timestampnumeric_valuestring_valuewarningValveNmTS-MS
2025-08-04T00:03:26.0110015-05:00null0nullXV0170458/4/2025 12:03:26.011
2025-08-04T00:03:27.0070037-05:00null0nullXV0170458/4/2025 12:03:27.007
2025-08-04T08:03:27.0070037-05:00null0nullXV0170458/4/2025 08:03:27.007
2025-08-04T11:23:27.0070037-05:00null0nullXV0170458/4/2025 11:23:27.007
2025-08-04T11:33:27.0070037-05:00null0nullXV0170458/4/2025 11:33:27.007
2025-08-04T12:03:27.0070037-05:00null0nullXV0170458/4/2025 12:03:27.007
2025-08-04T12:10:03.5070037-05:00null1nullXV0170458/4/2025 12:10:03.507
2025-08-04T12:50:58.5070037-05:00null0nullXV0170458/4/2025 12:50:58.507
2025-08-04T20:50:58.5070037-05:00null0nullXV0170458/4/2025 08:50:58.507

 

Join (left outer) from States to RS Samples via Valve -> ValveNm and TS-MS -> TS-MS (TS-MS is a text datatype)

merge.png

Result

Valvetimestampstring_valuenameIndexTS-MSDtRS Samples.string_value
XV0170452025-08-04T00:03:26.0110015-05:00UNDEFINEDPV_D194008/4/2025 12:03:26.0118/4/20250
XV0170452025-08-04T00:03:27.0070037-05:00CLOSEDPV_D194018/4/2025 12:03:27.0078/4/20250
XV0170452025-08-04T00:03:27.0070037-05:00CLOSEDPV_D194018/4/2025 12:03:27.0078/4/20250
XV0170452025-08-04T08:03:27.0070037-05:00CLOSEDPV_D194038/4/2025 08:03:27.0078/4/20250
XV0170452025-08-04T11:23:27.0070037-05:00CLOSEDPV_D194058/4/2025 11:23:27.0078/4/20250
XV0170452025-08-04T11:33:27.0070037-05:00CLOSEDPV_D194068/4/2025 11:33:27.0078/4/20250
XV0170452025-08-04T12:03:27.0070037-05:00CLOSEDPV_D194098/4/2025 12:03:27.0078/4/20250
XV0170452025-08-04T12:03:27.0070037-05:00CLOSEDPV_D194098/4/2025 12:03:27.0078/4/20250
XV0170452025-08-04T12:10:03.5070037-05:00OPENPV_D194118/4/2025 12:10:03.5078/4/20251
XV0170452025-08-04T12:50:58.5070037-05:00CLOSEDPV_D194138/4/2025 12:50:58.5078/4/20250
XV0170452025-08-04T20:50:58.5070037-05:00CLOSEDPV_D194158/4/2025 08:50:58.5078/4/20250

 

The ones in red are exact duplicates of each other.

 

What could be causing this, and is there a way to mitigate without using "Remove Duplicates" (the actual data set is nearly 1,000,000 rows each) ? The two queries come from different base tables, so creating an Index on RS_Samples for matching would not work.

 

I am on version 2.154.956.0 64-bit (May 2026)

 

Thanks,

David

 

1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

Can you verify that there are no duplicates when using the TS-MS column. From the example data you provided it looks like midnight and 12pm are both showing as 12:00:00 in your text column. This could be what is causing the duplicates...





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

Proud to be a Super User!





View solution in original post

2 REPLIES 2
jgeddes
Super User
Super User

Can you verify that there are no duplicates when using the TS-MS column. From the example data you provided it looks like midnight and 12pm are both showing as 12:00:00 in your text column. This could be what is causing the duplicates...





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

Proud to be a Super User!





@jgeddes - thank you so very much. I have been staring at this for days. Fixed the creation of the TS-MS column to use HH instead of hh in the format and the duplicates are gone.

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.