Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Can anyone suggest how I am able to set the enddate to my url query to always be the latest date rather than a set number? I'm new to Powerbi and newer to queries!
Currently it looks like this Source = Json.Document(Web.Contents("https://api.websitename.com/api/reportextracts/?reportID=2908&startDate=2021-11-01&endDate=2022-02-0...")),
I have also tried the following but get an error, but i'm not sure why. The API dates have to be formatted YYYY-MM-DD
endDateText = Date.ToText(DateTime.Date(DateTime.LocalNow()), "yyyy-mm-dd"),
Source = Json.Document(Web.Contents("https://api.websitename.com/api/reportextracts/?reportID=2908&startDate=2021-11-01&endDate=",endDateText)),
Error
Expression.Error: We cannot convert the value "2022-02-02" to type Record.
Details:
Value=2022-02-02
Type=[Type]
Solved! Go to Solution.
Try:
Source = Json.Document(Web.Contents("https://api.websitename.com/api/reportextracts/?reportID=2908&startDate=2021-11-01&endDate="&endDateText))
--Nate
Try:
Source = Json.Document(Web.Contents("https://api.websitename.com/api/reportextracts/?reportID=2908&startDate=2021-11-01&endDate="&endDateText))
--Nate
This worked - thankyou
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.