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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

Expression.Error: dynamic date in web source url

My web source has a dynamic date, I want it to always return today's date. I'm trying to create a work around to be able to refresh dynamic data in the cloud via BI but it's throwing back an error.

 

Code causing the issue (with example url https://www.website.com/data/date/date:2023-06-19😞

 

 

 

 

Source = Json.Document(Web.Contents("https://www.website.com/data/date"),
[RelativePath="date:"&(Date.ToText(DateTime.Date(DateTime.LocalNow()), "yyyy-MM-dd"))]),

 

 

 

 

1 REPLY 1
PhilipTreacy
Super User
Super User

Hi @Syndicate_Admin  

 

You've closed the Web.Contents function too early.  The closing bracket/parenthesis for that function needs to move like this

 

 

let
        RelPath = "date:" & Date.ToText(DateTime.Date(DateTime.LocalNow()), "yyyy-MM-dd"),
        Source = Json.Document(Web.Contents("https://www.website.com/data/date/" & RelPath))
in
        Source

 

 

In addition, trying create a Relative path with a : will give you an other error, something about the URIString not being variable.

 

That's why I added a step before Source where the Relative Path is created and then that's appended directly to the URL

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.