Power Query and Power Pivot differ on duplicates

macfuller

Active Member
Joined
Apr 30, 2014
Messages
319
Office Version
  1. 365
Platform
  1. Windows
Had an oddity that perhaps someone can explain.

I used Power Query to eliminate (I thought) duplicates in the data source for the column GHX Mfr Part #.

#"Filtered Rows" = Table.SelectRows(#"Changed Type", each [#"GHX Mfr Part #"] <> null and [#"GHX Mfr Part #"] <> ""),
#"Sorted Rows" = Table.Sort(#"Filtered Rows",{{"GHX Mfr Part #", Order.Ascending}}),
#"Removed Duplicates" = Table.Distinct(#"Sorted Rows", {"GHX Mfr Part #"})

I go into the Power Pivot data model and attempt to link tables with GHX Mfr Part # as one of the columns, but got the dreaded "The relationship cannot be created because each column contains duplicate values..."

Is there some better way to eliminate duplicates that Power Pivot will recognize?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Probably the issue is that Power Query is case-sensitive by default, while Power Pivot is not.
You can ignore the case when removing duplicates in Power Query, by supplying an additional parameter, e.g.:
#"Removed Duplicates" = Table.Distinct(#"Sorted Rows", {"GHX Mfr Part #", ComparerFromCulture(Culture.Current, true)})
 
Upvote 0
Thank you!

I used the dropdown options (Excel 2013) for removing dupes rather than writing the code. I can certainly go into Advanced Editor to make your suggested changes, but is there an option on the dropdown that I missed to ignore case? I had no idea this was default behavior by Power Query (probably have to review my copy of M is for Data Monkey again!) and it seems pretty important.
 
Upvote 0

Forum statistics

Threads
1,214,385
Messages
6,119,209
Members
448,874
Latest member
b1step2far

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top