Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I don't know if this is possible in PowerBi but I would like generate an API call based on the selected period in my "Calendar" filter.
If the selected period changes, the API call should refresh (either automatically or manually by clicking "Refresh").
In PowerQuery mode, my API works.
My question is: how do I retrieve the selected period so that I can pass the start_date and end_date values to my API call?
Example: By default the first call is made over a period from "01/01/2023" to "11/07/2023". So I have a table of data based on this period.
If the user changes the calendar period for example from "01/04/2023" to "11/07/2023", the API call would need to update and only cover this period.
If you have a solution to solve this problem it will be very appreciaded.
Thank you so much,
In theory yes, it might be possible - in practice no, you aren't going to be able to do this in any useable way. In order to do what you're describing here you'd need to have a DirectQuery dataset where the source is your REST API and that's what Power BI doesn't support: https://blog.crossjoin.co.uk/2021/04/25/can-i-build-a-power-bi-directquery-dataset-on-top-of-a-rest-...
Where does your REST API get its data from? The best thing to do is create an Import mode dataset to load all the data you need from that source. If that's not possible you could use your REST API as the source for the Import mode dataset, making as many calls as you need to load all the data that might ever need to be displayed in a report.
Hello @cpwebb
Thank you for your reply.
I must have a table based on the selection calendar because if I request all my API I will have data day by day.
Exemple :
| Date | visits | Bounce rate |
| 01/01/2023 | 1000 | 0,5 |
| 02/01/2023 | 5000 | 0,3 |
| ... | ... | ... |
| 11/07/2023 | 1300 | 0,4 |
It's not a problem if I create a measure to calculate "visits" column but my calcul will be wrong if I apply a measure on bounce rate column because the result of API is already an average. If I create a measure I will apply an average to another average :s
It's the reason why I must refresh my api call based on the user selection period.
Thank you 🙂
OK, well as I said you won't be able to do this with Power BI - your only option will be to get the raw data and recreate all the calculations in a measure.
Thank you @cpwebb
I will see how manipulate these data and maybe this feature will be available in the future Power Bi versions 🙂
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.