Forum Discussion
Anonymous
6 years agoNot applicable
Remove duplicates while retaining null/blank rows in a column
Need to remove duplicate values from a column that had a lot of null values too. Need to retain the null rows. Tried using query editor's remove duplicate rows function, but it removes all null valu...
- 6 years ago
Hi, Anonymous
let Source = Table.FromRecords(Json.Document(Binary.Decompress(Binary.FromText("i65WSlSyUko2NDJV0lFKAjIrKlKUanVgwiZQ0eLEdLhooiFMbTFcMK80JwcmVoxNJValSIZWGRlClaan58BF0+AOSM/G1J+ajc2q3JxiTKW5SEqT4Y4qT1WqjQUA",BinaryEncoding.Base64),Compression.Deflate))), result = Table.FromRows(List.Distinct(Table.ToRows(Source),each if _{0}=null then Text.NewGuid() else _{0})) in resultIf my code can solve your problem, Mark it as a solution
edhans
6 years agoCommunity Champion
You need to supply some data. You cannot use the Table.Distinct function here because 2 nulls are duplicates, and it will remove them.
This can be done, but not with the menu options. See links below to share data.
How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum