Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello all,
I was trying to refresh the dataset, but geting below error. Has anyone else come across this error? Any help is appreciated. Thank you!
I have following query in advance editor
Source = SharePoint.Contents("https://bat.sharepoint.com/sites/THEVAULT2", [ApiVersion = 15]),
#"Shared Documents" = Source{[Name="Shared Documents"]}[Content],
#"Power BI" = #"Shared Documents"{[Name="Power BI"]}[Content],
#"Daily Sales Report" = #"Power BI"{[Name="Daily Sales Report"]}[Content],
#"SAP Data" = #"Daily Sales Report"{[Name="SAP Data"]}[Content],
#"This Week" = #"SAP Data"{[Name="This Week"]}[Content],
#"Added Custom" = Table.AddColumn(#"This Week", "Custom", each Excel.Workbook([Content])),
#"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Content", "Custom"}),
#"Expanded Custom" = Table.ExpandTableColumn(#"Removed Other Columns", "Custom", {"Data"}, {"Data"}),
#"Expanded Data" = Table.ExpandTableColumn(#"Expanded Custom", "Data", {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12", "Column13", "Column14", "Column15", "Column16", "Column17", "Column18", "Column19", "Column20", "Column21", "Column22", "Column23", "Column24", "Column25", "Column26", "Column27", "Column28", "Column29", "Column30"}, {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12", "Column13", "Column14", "Column15", "Column16", "Column17", "Column18", "Column19", "Column20", "Column21", "Column22", "Column23", "Column24", "Column25", "Column26", "Column27", "Column28", "Column29", "Column30"}),
#"Removed Columns2" = Table.RemoveColumns(#"Expanded Data",{"Content"}),
#"Promoted Headers" = Table.PromoteHeaders(#"Removed Columns2", [PromoteAllScalars=true]),
#"Adding ZIPs and Previous Y" = Table.Combine({#"Promoted Headers", #"Current Year ZIP"}),
#"Removed Many Columns" = Table.RemoveColumns(#"Adding ZIPs and Previous Y",{"Sales Org.", "Distribution Channel", "Division", "Plant", "Customer Name", "Customer Name 2", "Street", "City", "Region", "Customer Classification","Delivery Number", "Currency", "Based UoM"}),
#"Removing Rejections" = Table.SelectRows(#"Removed Many Columns", each [Item Rejection Reason] = null or [Item Rejection Reason] = "51" or [Item Rejection Reason] = "61" or [Item Rejection Reason] = ""),
#"Removing Empty Dates" = Table.SelectRows(#"Removing Rejections", each [Requested Delivery Date] <> null and [Requested Delivery Date] <> ""),
#"Adjusting Routes" = Table.ReplaceValue(#"Removing Empty Dates",each [Route],each if [Route] = "01" then 1 else if [Route] = "02" then 2 else if [Route] = "03" then 3 else if [Route] = "06" then 6 else if [Route] = "07" then 7 else if [Route] = "08" then 8 else if Text.StartsWith([Route], "0000") then "" else [Route]
,Replacer.ReplaceText,{"Route"}),
#"Route Type" = Table.AddColumn(#"Adjusting Routes", "Route Type", each if [Route] = "6" then "Country" else if [Route] = "81" then "Country" else if [Route] = "86" then "Country" else if [Route] = "92" then "Country" else if [Route] = "94" then "Country" else if [Route] = "95" then "Country" else if [Route] = "99" then "Country" else if [Route] = "81" then "Country" else "Metro"),
#"Adjusting Returns" = Table.ReplaceValue(#"Route Type",each [Sales Order Type],
each if [Sales Order Type] = "ZCRQ" then "ZRE"
else if [Sales Order Type] = "ZDRQ" then "ZOR"
else [Sales Order Type],Replacer.ReplaceText,{"Sales Order Type"}),
#"SKU Key" = Table.AddColumn(#"Adjusting Returns", "SKU Key", each [Material Number] & [Sales UoM]),
#"Format as Date" = Table.TransformColumnTypes(#"SKU Key",{{"Requested Delivery Date", type date} }),
#"Add Year" = Table.AddColumn(#"Format as Date", "Year", each Date.Year([Requested Delivery Date])),
#"Merged Queries" = Table.NestedJoin(#"Add Year", {"Material Number", "Year"}, #"Gross Revenue 2021", {"SKU", "Year"}, "Gross Revenue 2021", JoinKind.LeftOuter),
#"Expand Gross Rev 2021" = Table.ExpandTableColumn(#"Merged Queries", "Gross Revenue 2021", {"Gross Rev"}, {"Gross Rev"}),
#"Merged Queries1" = Table.NestedJoin(#"Expand Gross Rev 2021", {"SKU Key"}, #"Products", {"SKU Key"}, "Products", JoinKind.LeftOuter),
#"Expand Sticks/Grams" = Table.ExpandTableColumn(#"Merged Queries1", "Products", {"Sticks/UOM"}, {"Sticks/UOM"}),
#"Remove Year and Material Num" = Table.RemoveColumns(#"Expand Sticks/Grams",{ "Material Number", "Year"}),
#"Changed Type All Columns" = Table.TransformColumnTypes(#"Remove Year and Material Num",{{"Sales Order Type", type text}, {"Route", type text}, {"Customer number", type text}, {"Customer Hierarchy Level 2", type text}, {"Purchase Order Type", type text}, {"Purchase Order Number", type text}, {"Sales Order Number", type text}, {"Order Quantity", type number}, {"Confirmed Qty", type number}, {"Total Value per Line Item", Currency.Type}, {"Item Rejection Reason", type text}, {"Route Type", type text}, {"SKU Key", type text}, {"Gross Rev", Currency.Type}, {"Sales UoM", type text}, {"Requested Delivery Date", type date}, {"Created on", type date}}),
#"Added Custom1" = Table.AddColumn(#"Changed Type All Columns", "Invoice on Day", each Date.DayOfWeek([Requested Delivery Date],Day.Monday)),
#"Day + 1" = Table.ReplaceValue(#"Added Custom1",each [Invoice on Day], each [Invoice on Day] + 1,Replacer.ReplaceValue,{"Invoice on Day"}),
#"Changed Type" = Table.TransformColumnTypes(#"Day + 1",{{"Invoice on Day", Int64.Type}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Requested Delivery Date", "Delivery Date"}, {"Customer number", "Customer Number Key"}, {"Customer Hierarchy Level 2", "CH Key"}, {"Sticks/UOM", "Sticks/Grams per Unit"}, {"Sales UoM", "Unit of Measure"}, {"Total Value per Line Item", "Sales Amount"}, {"Billing Number", "Invoice Number"}}),
#"Merged Queries2" = Table.NestedJoin(#"Renamed Columns", {"Sales Order Number"}, #"Critical Orders", {"Sales Order Number"}, "Critical Orders", JoinKind.LeftOuter),
#"Expanded Critical Orders" = Table.ExpandTableColumn(#"Merged Queries2", "Critical Orders", {"Critical Order"}, {"Critical Order"}),
#"Merged Queries3" = Table.NestedJoin(#"Expanded Critical Orders", {"Customer Number Key"}, Customers, {"Customer Number Key"}, "Customers", JoinKind.LeftOuter),
#"Expanded Customers" = Table.ExpandTableColumn(#"Merged Queries3", "Customers", {"Invoice Day Code"}, {"Invoice Day Code"}),
#"Changed Type2" = Table.TransformColumnTypes(#"Expanded Customers",{{"Invoice Day Code", Int64.Type}}),
#"Cust Following Schedule" = Table.AddColumn(#"Changed Type2", "Customer Following Schedule?",
each if [Invoice Day Code] = 0 then "Yes"
else if [Invoice Day Code]= null then "No Info in Delivery Diary"
else if [Invoice on Day] = 1 and ([Invoice Day Code]=1 or [Invoice Day Code]=13 or [Invoice Day Code]=14 or [Invoice Day Code]=124 or [Invoice Day Code]=135 or [Invoice Day Code]=1234) then "Yes"
else if [Invoice on Day] = 2 and ([Invoice Day Code]=2 or [Invoice Day Code]=23 or [Invoice Day Code]=24 or [Invoice Day Code]=25 or [Invoice Day Code]=124 or [Invoice Day Code]=245 or [Invoice Day Code]=1234 or [Invoice Day Code]=2345) then "Yes"
else if [Invoice on Day] = 3 and ([Invoice Day Code]=3 or [Invoice Day Code]=13 or [Invoice Day Code]=23 or [Invoice Day Code]=34 or [Invoice Day Code]=35 or [Invoice Day Code]=135 or [Invoice Day Code]=345 or [Invoice Day Code]=1234 or [Invoice Day Code]=2345) then "Yes"
else if [Invoice on Day] = 4 and ([Invoice Day Code]=4 or [Invoice Day Code]=14 or [Invoice Day Code]=24 or [Invoice Day Code]=34 or [Invoice Day Code]=124 or [Invoice Day Code]=245 or [Invoice Day Code]=345 or [Invoice Day Code]=1234 or [Invoice Day Code]=2345) then "Yes"
else if [Invoice on Day] = 5 and ([Invoice Day Code]=5 or [Invoice Day Code]=25 or [Invoice Day Code]=35 or [Invoice Day Code]=135 or [Invoice Day Code]=245 or [Invoice Day Code]=345 or [Invoice Day Code]=2345) then "Yes"
else "No"),
#"Added Custom3" = Table.AddColumn(#"Cust Following Schedule", "Invoice on Day Text", each if [Invoice on Day] = 1 then "Monday"
else if [Invoice on Day] = 2 then "Tuesday"
else if [Invoice on Day] = 3 then "Wednesday"
else if [Invoice on Day] = 4 then "Thursday"
else if [Invoice on Day]= 5 then "Friday"
else if [Invoice on Day] = 6 then "Saturday"
else if [Invoice on Day] = 7 then "Sunday"
else [Invoice on Day]),
#"Merged Queries25" = Table.NestedJoin(#"Added Custom3", {"Customer Number Key"}, Customers, {"Customer Number Key"}, "Customers", JoinKind.LeftOuter),
#"Expanded Customers285" = Table.ExpandTableColumn(#"Merged Queries25", "Customers", {"Channel"}, {"Group"}),
#"Merged Queries4" = Table.NestedJoin(#"Expanded Customers285", {"CH Key"}, Channel, {"CH Key"}, "Channel", JoinKind.LeftOuter),
#"Expanded Channel11" = Table.ExpandTableColumn(#"Merged Queries4", "Channel", {"Channel"}, {"Group.1"}),
#"Added Custom5" = Table.AddColumn(#"Expanded Channel11", "Changes in Hierarchy", each if [Group] = [Group.1] then "Same Hierarchy" else "Different Hierarchy"),
#"Renamed Columns115" = Table.RenameColumns(#"Added Custom5",{{"Group", "New Channel"}, {"Group.1", "Previous Channel"}}),
#"Changed Type1" = Table.TransformColumnTypes(#"Renamed Columns115",{{"Delivery Date", type datetime}, {"Created by", type text}}),
#"Renamed Columns1" = Table.RenameColumns(#"Changed Type1",{{"Invoice on Day Text", "Delivery Day"}, {"Invoice Day Code", "Delivery Day Code"}})
in
#"Renamed Columns1"
This is a step that expects a binary.
#"Added Custom" = Table.AddColumn(#"This Week", "Custom", each Excel.Workbook([Content])),
Excel.Workbook expects the [Content] to be a binary .xslx file but it's getting something else.
I'd try stepping through those first few steps to see what it is getting.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 143 | |
| 123 | |
| 102 | |
| 79 | |
| 54 |