March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
When I import data from a folder containing multiple excel documents it is double counting my data. So in other threads this has been said to be a rare bug but it happens to me almost everytime I get data from a folder. Why does this happen? It is doublecounting at the powerquery step and all subsequent power bi visuals will show the inflated data.
I have monkeyed around with the source data quite a bit and found that if I copy the data to a new excel file, delete the original, and refresh then I will get the correct numbers but what is causing it to happen to begin with?
Here is my PowerQuery:
let
Source = Folder.Files("C:\Users\User\Desktop\FolderName"),
#"Removed Other Columns" = Table.SelectColumns(Source,{"Content"}),
#"Added Custom" = Table.AddColumn(#"Removed Other Columns", "GetData", each Excel.Workbook([Content])),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Content"}),
#"Expanded GetData" = Table.ExpandTableColumn(#"Removed Columns", "GetData", {"Name", "Data", "Item", "Kind", "Hidden"}, {"GetData.Name", "GetData.Data", "GetData.Item", "GetData.Kind", "GetData.Hidden"}),
#"Added Custom1" = Table.AddColumn(#"Expanded GetData", "NoHeaders", each Table.PromoteHeaders([GetData.Data])),
#"Removed Other Columns1" = Table.SelectColumns(#"Added Custom1",{"NoHeaders"}),
#"Expanded NoHeaders" = Table.ExpandTableColumn(#"Removed Other Columns1", "NoHeaders", {"Name", "Type", "Name", "Customer Name", "Serial Number", "Part Number", "Invoice Date", "Points Earned", "Last Point Update", "Industry", "Brand"}, {"Name", "Type", "Name", "Customer Name", "Serial Number", "Part Number", "Invoice Date", "Points Earned", "Last Point Update", "Industry", "Brand"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded NoHeaders",{{"Points Earned", Int64.Type}, {"Last Point Update", type datetime}, {"Invoice Date", type datetime}})
in
#"Changed Type"
Solved! Go to Solution.
@ScrubberKing,
After you connecting to the folder in Power BI Desktop, why not directly expand the content column to get combined data of all excel files?
In your scenario, if you create table in a Excel sheet , Power BI will double count data((both sheet data and table table)) using the above power query code.
Regards,
Lydia
@ScrubberKing,
After you connecting to the folder in Power BI Desktop, why not directly expand the content column to get combined data of all excel files?
In your scenario, if you create table in a Excel sheet , Power BI will double count data((both sheet data and table table)) using the above power query code.
Regards,
Lydia
Seems to work pretty well. My orginal solution was created after watching this video:
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |