Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
what I want to do is to hand over the date from last year (-365 days) to a URL as text for my web source. As I'm pretty new to power query I tried this:
Source = Json.Document(Web.Contents("https://myurl.com/visits?startDate=" & Text.From(Date.Year(Date.AddDays(DateTime.LocalNow,-365))) & "-" & Text.From(Date.Month(Date.AddDays(DateTime.LocalNow,-365))) & "-" & Text.From(Date.Day(Date.AddDays(DateTime.LocalNow,-365)) & "&limit=500")))
But that does not work. Whats the best way to solve this?
Many thanks in advance!
Solved! Go to Solution.
Please try this syntax instead.
= Json.Document(Web.Contents("https://myurl.com/visits?startDate=" & Date.ToText(Date.AddYears(Date.From(DateTime.LocalNow()), -1), "yyyy-MM-dd") & "&limit=500"))
Pat
Please try this syntax instead.
= Json.Document(Web.Contents("https://myurl.com/visits?startDate=" & Date.ToText(Date.AddYears(Date.From(DateTime.LocalNow()), -1), "yyyy-MM-dd") & "&limit=500"))
Pat
Thank you!
Hi,
In your formula try replacing DateTime.LocalNow to DateTime.LocalNow().
Hi,
that was one of my mistakes, thanks!
User | Count |
---|---|
11 | |
7 | |
5 | |
5 | |
4 |
User | Count |
---|---|
15 | |
14 | |
8 | |
6 | |
6 |