|
本帖最后由 wffgg2008 于 2022-10-18 17:06 编辑
RT~各大神,望赐教,如何解?
出了点问题此数据集包含一个动态数据源。由于 Power BI 服务中不刷新动态数据源,因此不会刷新此数据集。
当power bi desktop发布到网络上后,重新赋值CityName2后,再刷新网络powerbi dashboard时不成功及出现如上问题。
如下查询会调用Location函数
let 源 = SharePoint.Contents("https://*****"),
Documents = 源{[Name="Documents"]}[Content],
#"CityName xlsx" = Documents{[Name="CityName.xlsx"]}[Content],
#"导入的 Excel 工作簿" = Excel.Workbook(#"CityName xlsx"),
表1_Table = #"导入的 Excel 工作簿"{[Item="表1",Kind="Table"]}[Data],
已调用自定义函数 = Table.AddColumn(表1_Table, "Location", each Location([CityName2])),
#"展开的“Location”" = Table.ExpandTableColumn(已调用自定义函数, "Location", {"Latitude", "Longitude"}, {"Location.Latitude", "Location.Longitude"}),
重命名的列 = Table.RenameColumns(#"展开的“Location”",{{"Location.Latitude", "纬度"}, {"Location.Longitude", "经度"}}),
删除的列 = Table.RemoveColumns(重命名的列,{"__PowerAppsId__"})
in 删除的列
Location函数如下,
let fxGetCoords = (city as text) =>
let
RAAA=Web.Contents("http://dev.virtualearth.net/REST/v1/Locations?query=" & city & "&includeNeighborhood=0&key=******"), Source = Json.Document(RAAA),
resourceSets = Source[resourceSets],
resourceSets1 = resourceSets{0},
resources = resourceSets1[resources],
resources1 = resources{0},
point = resources1[point],
coordinates = point[coordinates],
#"Converted to Table" = Table.FromList(coordinates, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Transposed Table" = Table.Transpose(#"Converted to Table"),
#"Renamed Columns" = Table.RenameColumns(#"Transposed Table",{{"Column1", "Latitude"}, {"Column2", "Longitude"}}),
#"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Latitude", type number}, {"Longitude", type number}})
in #"Changed Type"
in fxGetCoords
|
|