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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Quentin_
Helper I
Helper I

Api call dynamic date determine by the user

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,

4 REPLIES 4
cpwebb
Microsoft Employee
Microsoft Employee

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 :

 

DatevisitsBounce rate
01/01/202310000,5
02/01/202350000,3
.........
11/07/202313000,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 🙂

cpwebb
Microsoft Employee
Microsoft Employee

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 🙂

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors