Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
I have a CSV file with just over 13,000 rows. It is an export from a system and is stored in a SharePoint library from where Power BI imports it. The query looks like this:
let
Source = SharePoint.Files("https://sites.company.com/sites/sitename", [ApiVersion = 15]),
#"Filtered Rows" = Table.SelectRows(Source, each [Folder Path] = "https://sites.company.com/sites/sitename/foldername/subfoldername/"),
#"Filtered Rows1" = Table.SelectRows(#"Filtered Rows", each Text.StartsWith([Name], "FileName.csv")),
Navigation = #"Filtered Rows1"{[Name = "FileName.csv", #"Folder Path" = "https://sites.company.com/sites/sitename/foldername/subfoldername/"]}[Content],
#"Imported CSV" = Csv.Document(Navigation, [Delimiter = ",", QuoteStyle = QuoteStyle.Csv]),
#"Promoted headers" = Table.PromoteHeaders(#"Imported CSV", [PromoteAllScalars = true])
in
#"Promoted headers"The CSV file has no duplicate records (based on column [Instance ID] but when Power Query important it the rows are duplicated.
I've spent time googling this and duplicate rows from CSV imports seems to happen a lot not just in Powe Query but I've not found any solution or reason.
If I save just the header row and a single row in a new CSV file this does not happen. Note the issue happens both in Power Query Online (dataflow) and Power BI desktop (December 2023 release).
Does anybody have any ideas? Unfortunately I cannot share the CSV file.
@vgeldbr
Not sure how it happens without having a look at your query and debug. You can apply one more step to remove duplicates
Table.Distinct(#"Promoted headers", {"Instance ID"})
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 9 | |
| 8 | |
| 7 | |
| 6 | |
| 5 |