Forum Discussion
Error During Data Refresh
I am simply trying to Refrsh an existing dataset with an updated file. There are a series of steps I have taken in the Query Editor as well as renaming columns - but like my other work in Power BI I move the updated file, Click Refresh and was expecting the data to update.
I am wondering if changing the column names or some of the cleanup I am performing in the Query Editor are corrupting the process.
Maybe.
Can you share your query code (copy/paste from the advanced editor)?
- MarcelBeug9 years agoCommunity Champion
As an example, this is the error I get when importing files from a folder and Book3.xlsx is missing:
- Anonymous9 years agoNot applicable
let
Source = Excel.Workbook(File.Contents("C:\Users\-----\OneDrive - XXXX.xlsx"), null, true),
#" Daily Report_Sheet" = Source{[Item="Daily Report",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(#"Daily Report_Sheet", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"event_date", type date}, {"publisher_id", Int64.Type}, {"publisher_name", type text}, {"advertiser_id", Int64.Type}, {"advertiser_desc", type text}, {"campaign_id", Int64.Type}, {"campaign_desc", type text}, {"line_item_id", Int64.Type}, {"line_item_desc", type text}, {"line_item_start_date", type date}, {"line_item_end_date", type date}, {"status", type text}, {"pricing_type", type text}, {"bid_amount", type number}, {"ad_slot_id", Int64.Type}, {"ad_alot_name", type text}, {"ad_slot_status", type text}, {"size", type text}, {"mail_type", type text}, {"template_id", Int64.Type}, {"template_name", type text}, {"impresions", Int64.Type}, {"clicks", Int64.Type}, {"conversions", Int64.Type}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"impresions", "Impressions"}, {"clicks", "Clicks"}}),
#"Duplicated Column" = Table.DuplicateColumn(#"Renamed Columns", "publisher_name", "publisher_name - Copy"),
#"Replaced Value" = Table.ReplaceValue(#"Duplicated Column","ACBJ","",Replacer.ReplaceText,{"publisher_name - Copy"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","(","",Replacer.ReplaceText,{"publisher_name - Copy"}),
#"Replaced Value2" = Table.ReplaceValue(#"Replaced Value1",")","",Replacer.ReplaceText,{"publisher_name - Copy"}),
#"Renamed Columns1" = Table.RenameColumns(#"Replaced Value2",{{"publisher_name - Copy", "Market"}, {"advertiser_desc", "Advertiser"}, {"template_name", "Product"}, {"size", "Size"}, {"event_date", " Date"}, {"Impressions", "Impressions2"}, {"Clicks", "Clicks2"}, {"line_item_desc", "Line Item Description"}})
in
#"Renamed Columns1"- MarcelBeug9 years agoCommunity Champion
Probably the error occurs at step #" Daily Report_Sheet"?
Then there is no record in your Source with Item="Daily Report" and Kind="Sheet".
You can check if you select the Source step in the qury editor and check that table (which is a so called navigation table with accessible elements in your Excel Workbook).
In the code I see #" Daily Report_Sheet" and #"Daily Report_Sheet".
These should be the same.