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
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
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 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.

Top Solution Authors