Forum Discussion
Dynamically change query parameter
- 9 years ago
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.
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.
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.
- Use direct query mode in your report.
- Create a view or function in your SQL database to load all data, without any where condition.
- 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.
- 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)