Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Steve_I
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
v-shex-msft
Community Support
Community Support

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.

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.

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.

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

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.

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?

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.

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

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.