如何使用 URL 查询参数来设置 PowerBI 中的 ‘Parameters’ 值?

huangapple go评论63阅读模式
英文:

How can I use url query parameter to set the value of a 'Parameters' in PowerBI?

问题

在PowerBI中,我有一个受控参数,它是一个文本列表。
abcdefghi

而且该参数被用于调用PowerBI中的自定义函数,即MyCustomFunction(@Name)

我的问题是,当我加载报告(在发布到PowerBI服务后)时,如何从URL更改参数的值?

例如,我想要:

https://mypowerbi url?filter Name eq 'abc'
将调用`MyCustomFunction('abc')'。

https://mypowerbi url?filter Name eq 'def'
将调用`MyCustomFunction('def')'。

如何使用 URL 查询参数来设置 PowerBI 中的 ‘Parameters’ 值?

英文:

In PowerBI, I have a managed parameter which is a list of text.
abc, def, ghi.

And that parameter is being use to call a custom function in powerbi i.e. MyCustomFunction(@Name)

My question is how can I change the value of the parameter from the url when I load the report (after i published it to PowerBI service)?

i.e. I would like to

https://mypowerbi url?filter Name eq 'abc'  
`MyCustomFunction('abc')' will be called.

https://mypowerbi url?filter Name eq 'def'  
`MyCustomFunction('def')' will be called.

如何使用 URL 查询参数来设置 PowerBI 中的 ‘Parameters’ 值?

答案1

得分: 1

无法更改 URL 中的参数值,当您加载报告(在将其发布到 PowerBI 服务之后)时。在 Power BI 报告中,URL 查询参数可以用于筛选报告。请参阅使用 URL 中的查询字符串参数筛选报告

参数只能在分页报告中(来自 SSRS 的传统)从 URL 中设置。请参阅通过 URL 传递 Power BI 分页报告的报告参数

对于发布到 Power BI 服务的 Power BI 报告,参数值可以从数据集的设置中更改。请参阅在 Power BI 服务中编辑参数设置。请注意,这会影响看到报告的所有用户,而不仅仅是您的查看会话。更改导入数据集的参数值通常需要进行数据集刷新,以使更改生效。

已发布报告的参数还可以使用 Power BI 的 REST API 进行更新 - 请参阅更新参数在组中更新参数

英文:

> My question is how can I change the value of the parameter from the url when I load the report (after i published it to PowerBI service)?

You can't. In Power BI reports, the URL query parameters can be used to filter the report. See Filter a report using query string parameters in the URL

Parameters can be set from the URL in paginated reports only (legacy from SSRS). See Pass a report parameter within a URL for a Power BI paginated report.

For Power BI reports published to Power BI Service, the parameter values can be changed from the dataset's settings. See Edit parameter settings in the Power BI service. Keep in mind that this affects all users, who see the report, and it is not something that can affect your viewing session only. Changing parameter values of imported datasets usually will take a dataset refresh for the changes to take effect.

Parameters of published reports can also be updated using the Power BI's REST API - see Update Parameters and Update Parameters In Group.

huangapple
  • 本文由 发表于 2023年6月2日 13:27:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/76387354.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定