【问题标题】:Power BI Report: How to pass Dynamic Values to Parameters in Report Made with Stored ProcedurePower BI 报表:如何将动态值传递给使用存储过程制作的报表中的参数
【发布时间】:2019-02-07 15:21:15
【问题描述】:
let
    Source = Sql.Database(MyServer, MyDatabase, [Query="EXEC  [dbo].[spEmployeesRead] '" & ActionCode & "', '" & UserID & "', NULL, NULL, NULL, NULL, '" & Alphabet & "'"])
in
    Source

上面是我在查询编辑器中的存储过程,它运行良好并获取数据,因为我正在动态传递所有参数,包括服务器名称和数据库名称。我的问题是我已将报告保存并发布到 Power BI 服务,然后打开报告并从文件菜单获取嵌入代码并将参数传递给此报告 URL,以便我可以从其他应用程序访问它,并且该应用程序将动态传递参数值但似乎事情无法正常工作。谁能检查我哪里错了。

https://app.powerbi.com/reportEmbed?reportId=341f891b-93f8-490a-9a91-62f12f783e2c&groupId=4791121d-01f2-49ad-99fc-9fa3bab7fc3f&autoAuth=true&filter=MyServer eq 'MSSQLSERVER2017' and MyDatabase eq 'TestDB' and EmployeesList/ActionCode eq '1' and EmployeesList/UserID eq '1' and EmployeesList/Alphabet eq 'All'

Attached Image Attached Image

【问题讨论】:

  • [app.powerbi.com/… eq 'MSSQLSERVER2017' and MyDatabase eq 'TestDB' and EmployeesList/ActionCode eq '1' and EmployeesList/UserID eq '1' and EmployeesList/Alphabet eq 'All' ] **The上面的 URL 向我显示数据,但它没有在我更改参数值时过滤记录......即 ActionCode = 1 或 ActionCode = 2 Alphabet = "All" 或 Alphbet = "B" **
  • 使用 URL 查询字符串参数可以过滤报表,但它们不会更改报表参数值,即不会使用 URL 中传递的值重新执行存储过程。

标签: report powerbi powerbi-embedded powerbi-desktop power-bi-report-server


【解决方案1】:

没有可用于此条件的直接 url 查询。

您需要添加参数,然后将您的参数与自定义函数绑定,然后您可以创建如下网址:

ReportURL?filter=tableName/columnName eq 'value'。

您可以查看以下视频网址以创建参数和自定义功能:

https://www.youtube.com/watch?v=iiNDq2VrZPY

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-11-26
    • 1970-01-01
    • 2019-06-11
    • 1970-01-01
    • 2023-04-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多