I have a Power BI report that I have created four parameters in. These are used to pass to an API call which is the data source.
I have not been able to work out how to call the Power BI report passing it values for these four parameters. Is there a way to do this? Please note that these are Power BI parameters and not filters.
You can refer to below links about call api with power query:
I am not sure that these solve my problem. I have a Power BI report that I have defined parameters in. I want to be able to sent the value of those parameters in a call to the report. Currently including from your link https://community.powerbi.com/t5/Desktop/Passing-a-parameter-to-a-URL/td-p/103363 I can only see that you can only change parameter values manually in Power BI desktop.
>>I have a Power BI report that I have defined parameters in.
So you defined your parameter in report, such as use a measure or slicer, right?
If this is a case, current power bi not support to use these as the parameter.
datasource(database) -> Analysis Table(Power query/parameters) -> Data model(Calculate column/Table) -> Visual(Slicer/measure)
Slicer and measure are works on visual level, they can't effect the source data.(query parameter can affect the source table)
@v-shex-msft, I created parameters using the Query Editor. I am passing these parameters to an API call in Power BI.
I want to be able to dynamically change the value for these parameters when calling Power BI report.
I'd like to suggest you use another query as the parameter, then you can dynamic change it by modify the source data of the query.
Add a xml file and return the analysis the string, use it as the parameter to invoke your api.
<root> <RECORD> <FIELD ID="1" Text="Name"/> <FIELD ID="2" Text="Age"/> <FIELD ID="3" Text="Password"/> </RECORD> </root>
Then you can use above query name to call this analysed parameter.
BTW, parameters query only works on power bi desktop.
HI @v-shex-msft, I already have the call to the API passing the parameters inside PowerBI.
What I need to know is can I call the PowerBI report, passing it values for the parameters, or can you only change the value of a parameter inside PowerBI?
>>What I need to know is can I call the PowerBI report, passing it values for the parameters,
Current you can't pass the value form the report(for example: slicer, measure, calculae column) to power query function.
>>can you only change the value of a parameter inside PowerBI?
The method which I mentioned is dynamic change the parameter without manual "Edit parameter" in power bi.(The parameter is analysis by other source data, you can use it in your custom function. If you modify the source data and refresh, the analysis parameter will be changed)
Hello again @v-shex-msft,
Thank you for your continued input. I have managed to use XML as the data soruce to bring in the value for Account, however how do I use this value in the call to the API? I can only see ot use text or a parameter to call the API.
You can try to choose "Text" and input some text, then apply this function. After these steps, you can open "advanced editor", find out the inputted text and use analysis text from other query(e.g from xml) to replace this parameter.
Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.
Join this community-driven Power Platform digital event for unbiased support and problem-solving.
Visit our Community Blog for articles, guides, and information created by fellow community members.