cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Passing parameters to a call of a Power BI report

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.

9 REPLIES 9
Highlighted
Community Support
Community Support

Re: Passing parameters to a call of a Power BI report

Hi @Steve_I,

 

You can refer to below links about call api with power query:

 

Web.Contents

Working with Web Services in Power Query

Passing a parameter to a URL

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Highlighted
Frequent Visitor

Re: Passing parameters to a call of a Power BI report

Hello @v-shex-msft,

 

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.

Highlighted
Community Support
Community Support

Re: Passing parameters to a call of a Power BI report

Hi @Steve_I,

 

>>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.

 

Data Level:

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)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Highlighted
Frequent Visitor

Re: Passing parameters to a call of a Power BI report

@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.

Highlighted
Community Support
Community Support

Re: Passing parameters to a call of a Power BI report

Hi @Steve_I,

 

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.

 

For e.g:

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>

Capture.PNGCapture2.PNG

 

 

Then you can use above query name to call this analysed parameter.

 

BTW, parameters query only works on power bi desktop.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Highlighted
Frequent Visitor

Re: Passing parameters to a call of a Power BI report

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?

Highlighted
Community Support
Community Support

Re: Passing parameters to a call of a Power BI report

Hi @Steve_I,

 

>>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)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Highlighted
Frequent Visitor

Re: Passing parameters to a call of a Power BI report

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.01-05-2017 5-04-31 PM.png

Highlighted
Community Support
Community Support

Re: Passing parameters to a call of a Power BI report

Hi @Steve_I,

 

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.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Upcoming Events

Community Summit North America – Join Online!

Join this community-driven Power Platform digital event for unbiased support and problem-solving.

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Top Solution Authors