【发布时间】:2020-06-24 16:10:01
【问题描述】:
我们有一个重要的仪表板,通过电源查询从我们的 Excel“数据库”中提取数据。我将它设置为每 30 分钟自动刷新一次,然后手动刷新。检查数据库,我看到有新数据(几十行),但是仪表板在过去 8 小时内没有显示新数据。当我点击“刷新”或“全部刷新”时,它确实显示它正在运行查询,但此后仍然没有新数据。
我错过了什么?如果我没有提供所有必要的信息,我深表歉意,Power Query 对我来说是新的,因为这些仪表板以前在 Google 表格中,我可以使用 IMPORTRANGE() 在表格之间提取数据。
代码:
let
Source = Excel.Workbook(File.Contents(Excel.CurrentWorkbook(){[Name="fPath"]}[Content]{0}[Column1] & "\Collin Walch - Analytics\Inside Sales Dashboards\PestMateDataDump.xlsm"), null, true),
SMR_Sheet = Source{[Item="SMR",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(SMR_Sheet, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"First Name", type text}, {"Last Name", type text}, {"Customer Id", Int64.Type}, {"Branch", type text}, {"Service Template", type text}, {"Service Type Id", type any}, {"Primary Lead Source", type text}, {"Secondary Lead Source", type text}, {"Date Created", type date}, {"Time Created", type datetime}, {"Prospect Date Created", type date}, {"Prospect Time Created", type datetime}, {"Became Assigned Prospective Service Type Time", type datetime}, {"Date Contacted", type any}, {"Contacting Sales Rep", type text}, {"First Contact Method", type text}, {"Confirming Sales Rep", type text}, {"Transferred From Sales Rep", type text}, {"Date Transferred", type any}, {"Receiving Sales Rep", type text}, {"Date Received", type any}, {"Prospect Status", type text}, {"Lead Type", type text}, {"Non Sale Reason", type text}, {"Non Lead Reason", type text}, {"Date Sold", type any}, {"Created By User", type text}, {"Structure Type", type text}, {"Not Sold Original Non Sale Reason Employee", type text}, {"Extra Sales Rep Name", type text}, {"Marketing Lead", Int64.Type}, {"Recurring", Int64.Type}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each Date.IsInCurrentWeek([Date Created]))
in
#"Filtered Rows"
Excel.CurrentWorkbook(){[Name="fPath"]}[Content]{0}[Column1] 从指定范围获取当前文件路径,以便可以从我们的任何一台计算机上对其进行更新。
还有其他 4 个查询。其他 1 个来自同一来源,1 个来自同一文件夹中的另一个 Excel 工作表,2 个来自在线资源。这些也设置为每 3-7 分钟刷新一次。
【问题讨论】:
-
我怀疑如果没有 M 代码,这将很难诊断。
-
所以从显而易见的开始 - 我假设文件已经保存了新数据?
fpath变量指向正确的文件? -
是的,这些都是正确的。它实际上刚刚更新,但在我的前 4 次手动刷新时没有更新,它应该每 30 分钟自动更新一次。
标签: excel powerquery