Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
HI,
I have an Web based API where I currently include fixed dates in Epoch format. The API looks something like this ( sections redacted for security )
Source = Json.Document(Web.Contents("
https://******/api/*******/venue/4/events/hourly-visitors"
& "?comparison_date=1720656000&event_date=1721260800&from_hour=17&to_hour=19" & "&zone_ids=159,165", [Headers=[Authorization="Bearer *******************************"]])),
Is it possible to allow the end user to select a date from a date picker that is then inserted into the API string to get the required data rather than me fixing it and having to craete a new query every time someone wants data for a different date ?
Hi @Pigsfoot ,
I think in import mode such scenario is not possible to implement. For Direct query mode this is possible.
You can change parameter value in power bi desktop using edit parameter option or in power bi service setting option for import query mode.
If you interested to use edit parameter for import query option, then in power query create parameter and replace hardcoded date with the parameter.
First create a date query using list.date funtion. Chk image:
Then Create parameter, for my case startdate. Check image:
For your case you need to convert date to Epoch Format.
Replace hard code date with the parameter. Check image:
Close and load. In power Bi Desktop, change date through edit parameter option. Check image:
Select any date you want your souce to update. Check image:
Similarly, in power bi service through setting option:
Go to parameter to change value:
Hope this helps!!
If this solved your problem, please accept it as a solution!!
Best Regards,
Shahariar Hafiz
Yes, it is possible to allow end users to select a date using a date picker in Power BI, and then dynamically insert the selected date into the API string.
Here’s how you can achieve this:
Add a Date Picker:
Convert the Selected Date to Epoch Format:
Modify the Power Query to Use the Selected Date:
Here’s an outline of the changes:
Pass the Selected Date to the Parameter:
@SwapnilmandloiThank you for the reply. I have bene trying to get this to work but i'm stuck on point 4.
Can you expand at all on how i link the date from the new date picker to the parameter? Thanks
Your solution is great shafiz_p
Hi, @Pigsfoot
You should follow shafiz_p's method to practice it. When a user changes this parameter in Power BI Service it will update your data loaded into Power BI. You cannot use the slicer to perform this operation because the slicer uses columns that are already loaded into the model and you try to pass the parameter before loading.
Here are some cases where a similar issue has been discussed before:
Solved: Pass parameters dynamically from Power BI to REST ... - Microsoft Fabric Community
Here are some examples of using this method:
Parameterize an API request in Power Query – Wise Data Decisions
This example is the same as the one shown by shafiz_p.
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.