gpt4 book ai didi

powerbi - 如何在Power BI服务上刷新使用自定义函数的报表?

转载 作者:行者123 更新时间:2023-12-02 21:23:48 25 4
gpt4 key购买 nike

我知道这个问题之前已发布过多次,但我无法获得可靠/有效的解决方案。

我正在尝试找出一种解决方法,通过 Power BI 服务使用自定义函数刷新数据集。我的查询如下所示:

let
Clients = Json.Document(Web.Contents("https://api.createsend.com/api/v3.2/clients.json")),
#"Converted to Table" = Table.FromList(Clients, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"ClientID", "Name"}, {"ClientID", "Name"}),

GetDetails = (ClientID as text) =>
let
Source = Json.Document(Web.Contents("https://api.createsend.com/api/v3.2/clients/" & ClientID & "/campaigns.json"))
in
Source,
Output = Table.AddColumn(#"Expanded Column1", "Details", each GetDetails([ClientID])),
#"Expanded Details" = Table.ExpandListColumn(Output, "Details"),
#"Expanded Details1" = Table.ExpandRecordColumn(#"Expanded Details", "Details", {"Name", "FromName", "FromEmail", "ReplyTo", "SentDate", "TotalRecipients", "CampaignID", "Subject", "WebVersionURL", "WebVersionTextURL"}, {"Details.Name", "Details.FromName", "Details.FromEmail", "Details.ReplyTo", "Details.SentDate", "Details.TotalRecipients", "Details.CampaignID", "Details.Subject", "Details.WebVersionURL", "Details.WebVersionTextURL"})
in
#"Expanded Details1"

这在 Power BI 桌面上运行良好。但是,我在 Power BI 服务上收到以下错误: Query contains unknown or unsupported data sources

最佳答案

我设法让它发挥作用。经过一些研究,我们发现实际的问题不是函数,而是动态 API 路径本身。 Power BI 在刷新服务报告之前验证静态数据源路径。

我通过替换解决了问题:

Source = Json.Document(Web.Contents("https://api.createsend.com/api/v3.2/clients/" & ClientID & "/campaigns.json"))

这样:

Json.Document(Web.Contents("https://api.createsend.com/", [RelativePath="api/v3.2/clients/" & ClientID & "/campaigns.json", Headers=[#"Authorization"="My API Authorization token"]]))

关于powerbi - 如何在Power BI服务上刷新使用自定义函数的报表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53568536/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com