You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Power BI中OData连接URL动态修改及钻取报错咨询

Power BI OData钻取时TenantID无效,但直接访问子URL正常

我需要从Microsoft Reports URL拉取数据构建高管报告,共需获取约12份报告。初始OData连接可正常获取所有可用报告列表:

let
  Source = OData.Feed("https://reports.office.com/internal/ux?tenantid="&tenantID&"&Aggregate=M30", null, [Implementation = "2.0"])
in
  Source

但在钻取表格时出现TenantID无效报错,对应的M代码如下:

let
  Source = OData.Feed("https://reports.office.com/internal/ux?tenantid=" & tenantID & "&Aggregate=M30", null, [Implementation = "2.0"]),
  #"Drill down" = Source{21}[Data]
in
  #"Drill down"

错误信息:

DataSource.Error: OData: Request failed: The remote server returned an error: (400) Bad Request.
({"error":{"code":"InvalidTenantId","message":"The tenant ID you provided is not in the correct format. Please check the ID and try again."}})
DetailsReason = DataSource.Error ErrorCode = 10122
DataSourceKind = OData DataSourcePath = https://reports.office.com/internal/ux/getCopilotActivityUserDetailV4
Url = https://reports.office.com/internal/ux/getCopilotActivityUserDetailV4

然而直接使用完整子URL却能正常获取钻取数据,对应的M代码:

let
  Source = OData.Feed("https://reports.office.com/internal/ux/getCopilotActivityUserDetailV4?tenantid=" & tenantID & "&Aggregate=M30", null, [Implementation = "2.0"])
in
  Source

这是我首次接触Power BI与OData数据源,恳请指导解决方案。

内容的提问来源于stack exchange,提问作者Rude Dawg

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.11 15:03:19