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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
keithpoplar
Frequent Visitor

Dynamically change query parameter

1. Is it possible to change query parameter dynamically using REST API or URL query string? Because I am integrating Power BI report in my own application so this is important to me. I know I can pass filter in URL to filter dataset but I am aksing query parameter here.

 

2. When a report is published to Power BI cloud service, is it possible to chagne query parameter?

 

Thanks.

1 ACCEPTED SOLUTION
ankitpatira
Community Champion
Community Champion

@keithpoplar There is Power BI REST APIs that you can use to automate certain tasks. Documentation for that is here and listed operations. I don't see anything for query parameters.

 

There is Power BI Embedded which is Azure service. There are several REST operations available for that and can check them out here. Again no operation for query parameters I can see.

 

Query parameters are currently only supported in power bi desktop and not in power bi service and that is why you don't see operations for them via APIs as well.

View solution in original post

10 REPLIES 10
Anonymous
Not applicable

I am new to Power BI. Can you please tell me how to pass filter in URL to filter dataset.

simagandhi12345
Regular Visitor

Hello,


I have one power Bi report which i have loaded in my .net web application using embed-a-report-into-an-app.

In this report i have used web api to get data. I have to pass LOGIN USER ID AND COMPANY ID from web application to power bi for create dynamic web api url.

 

Any body have idea on that?

 

Thanks in Advance.

 

 

 

ankitpatira
Community Champion
Community Champion

@keithpoplar There is Power BI REST APIs that you can use to automate certain tasks. Documentation for that is here and listed operations. I don't see anything for query parameters.

 

There is Power BI Embedded which is Azure service. There are several REST operations available for that and can check them out here. Again no operation for query parameters I can see.

 

Query parameters are currently only supported in power bi desktop and not in power bi service and that is why you don't see operations for them via APIs as well.

Is this still true? Correct me if I'm wrong but I can't use query parameters with Power BI embedded?

 

Thanks,

Enes

Markzolotoy
Impactful Individual
Impactful Individual

I am on exactly same journey trying to figure out how to make reports without data parameters. Can't really comprehend how to run SQL statements without parameters. One guy here recommended to get all the data into the report and then use a slicer. Forgot to tell him that I am querying Historiians with millions of records and even more.

@Markzolotoy were you able to find solution for this , please share if you have any info , I am pretty new to power bi and in same delima how can i enable user to change parameters give its huge database can not load all and everything .

My Power bi report is also loading data from millions of records. And I figured out I don't really need report parameters like SSRS.

Here is how I approach the problem.

  1. Use direct query mode in your report.
  2. Create a view or function in your SQL database to load all data, without any where condition.
  3. In Power BI desktop, create some dimension tables based on how you want to filter the data and build the relationship with your data table.
  4. Now you have two options to interactively change the report filter
    • Use data slicer to select your dimension table, your data table will be filtered
    • Use Power BI Javascript library to build custom filter controls on web pages. (This is my option as I need to use date time range picker)

 

Depends on the number of data points. If it is millions then better to query while loading rather than filtering after. There is a post from Microsoft but somehow I can't make it work. https://docs.microsoft.com/en-us/power-bi/paginated-reports/report-builder-url-pass-parameters

 

Data for a report is relevant to a user that runs the report. In your scenario where a user id can be applied? Is it on the SQL Server where data is selected?

@ankitpatira: is this feature available for Power BI Service? I think, this is a nice feature if it is included in Power BI Service.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors