Forum Discussion
I cannot remove duplicate values
- 5 years ago
THere are a few things you can check. Power Query is case sensitive, so Apple, APPLE, and apple will not consolidate down to Apple if you remove duplicates. All 3 will remain. You need to change them all to proper, upper, or lower case.
"Apple" and "Apple " are not the same either. The latter has a space. Use TRIM or maybe CLEAN. TRIM is better for spaces, CLEAN will remove non-printing chars.
Other than that, you will need to provide data. Remove Duplicates works just fine, there is no bug. So it is something in how you are doing it or in the data that is preventing it.
How to get good help fast. Help us help you.
How To Ask A Technical Question If you Really Want An Answer
How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.
You cannot remove duplicates in Power BI's data model - you can filter, but not remove.
In Power Query, you can, There are two ways to do it. Right-click on a column and that will remove duplicates from that column regardless of what is in the other columns. Or, in the grid view, click the little table icon in the upper left corner to get the menu. Near the bottom is Remove Duplicates - this will only remove rows that are duplicates - every value in a column is checked.
Note though that this will NOT remove all nulls, which will cause a problem if you are trying to create a DIM table with a 1 to Many relationship. DIM tables cannot have nulls in their primary key, so usually I do both - remove duplicates on the primary key, then remove empty.
If that isn't what you need, please give us more info. We cannot see your dataset nor do we understand your data.
How to get good help fast. Help us help you.
How To Ask A Technical Question If you Really Want An Answer
How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.
I have tried to remove duplicate values in Power Query. The duplicates aen't from null values. For some reason I cannot delete them.
- edhans5 years agoCommunity Champion
THere are a few things you can check. Power Query is case sensitive, so Apple, APPLE, and apple will not consolidate down to Apple if you remove duplicates. All 3 will remain. You need to change them all to proper, upper, or lower case.
"Apple" and "Apple " are not the same either. The latter has a space. Use TRIM or maybe CLEAN. TRIM is better for spaces, CLEAN will remove non-printing chars.
Other than that, you will need to provide data. Remove Duplicates works just fine, there is no bug. So it is something in how you are doing it or in the data that is preventing it.
How to get good help fast. Help us help you.
How To Ask A Technical Question If you Really Want An Answer
How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.- Anonymous5 years agoNot applicable
Using Trim worked. Thank you.
- edhans5 years agoCommunity Champion
Perfect Anonymous - so it was extra spaces somewhere. Trim will safely remove leading and trailing spaces for you - never in the middle though, so no actual data changed. Glad I was able to help!