Forum Discussion
Apply Date Slicer Filter using C# SDK or Power BI Rest API for a Power BI Report
Hi Anonymous, Thanks for the reply.
I want to apply filters dynamically by passing different date ranges, So bookmarks won't satisfy my requirement.
Thanks | Neehar
- Anonymous4 years agoNot applicable
Hi Neehar ,
Please review the following links, and check if their methods can be used as an workaround.
How to set selected value from slicer to API in PowerBi
PowerBI does not work like a web development framework. You cannot "post" the selection in a slicer to an API.
I can think some options that could give an acceptable alternative:
-
You import all the data from the API endpoint. Then use the slicer to slice as designed. For large amounts of data (in the API) there are techniques for paging that data in to PowerBI using M. Here is an example. PowerBI will handled gigabytes of data with ease although the API might not be up to the task.
-
Use an intermediate database / datamart / datawarehouse to model the data and run your PowerBI on top of the datastore. With this approach you can use DirectQuery to limit the data you process through to PowerBI.
-
If you are working locally and only using PowerBI desktop. You can set parameters in your PowerBI file and then supply the time through the parameters. If you save your PowerBI file as a PowerBI template (PBIT), then it saves your PowerBI without any data. When you open the template it will prompt you to supply the parameters.
Not quite a 100% answer but I hope it gives you some options to consider.
Making dynamic API call using a slicer/filter
Best Regards
-