Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello people,
I am using a JSON API string to fetch date from a date range which is parameterized. Because of that I have to change values everyday to fetch details. This URL look something like this :
Source = Json.Document(Web.Contents(XXXXXX&from_date=2018-07-01+00%3A00%3A00&to_date=2018-07-18+12%3A00%3A00&XXXXX"))
Now I need to set to_date as TODAY() in yyyy-mm-dd hh:mm:ss format. Help me with this.
Thanks and Regards,
Piyush
Hi Piyush,
Please try the function datetime-localnow. It could be like below.
let now = DateTime.LocalNow(), Source = Json.Document(Web.Contents(XXXXXX&from_date=2018-07-01+00%3A00%3A00&to_date=now)) in Source
Best Regards,
Dale
Hi Dale,
Thanks for your help. I tried your way but it's not resolving my purpose instead it's showing following error :
I also tried this -> now = Date.AddDays(Date.From(DateTime.LocalNow()),-1),
Kindly suggest
Thanks,
Piyush
Hi Piyush,
It seems the error was raised by other errors. Can you share the file or the Power Query code?
Best Regards,
Dale
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |