Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I get data via json
let
content = "
{
""dimensions"": [""daily""],
""metrics"": [""visits"",""leads"",""sales"",""profit"",""marketing_cost"",""roi""],
""period"": {
""from"":""2017-06-06T00:00:00+0300"",
""to"":""2017-07-05T23:59:59+0300""
}
}
", How to insert in "to" current date automatically in extended editor? Thank you!
Solved! Go to Solution.
See text below.
""to"":""" & DateTime.ToText(DateTime.LocalNow(), "yyyy-MM-dd") & "T00:00:00+0300""
let
content = "
{
""dimensions"": [""daily""],
""metrics"": [""paidLeadsPrice"",""visits"",""leads"",""sales"",""profit"",""visitsCost"",""roi""],
""period"": {
""from"":""2017-06-01T00:00:00+0300"",
""to"":""2017-07-01T00:00:00+0300""
}
}
",
Source = Json.Document(Web.Contents("https://cloud.roistat.com/api/v1/project/analytics/data?project=50147&key=52d70cb079888f14092d5e9e13e3c3cb", [Content=Text.ToBinary(content)]))
in
SourceThis is a working example, please show how to insert the current date in the field ""to"" automically?
See text below.
""to"":""" & DateTime.ToText(DateTime.LocalNow(), "yyyy-MM-dd") & "T00:00:00+0300""
In addition, you may need to use DateTime.ToText.
If I paste that code into Advanced Editor it errors. That also does not appear to be valid JSON syntax so I am a little confused. Date.LocalNow will return the current date and time.
https://msdn.microsoft.com/en-us/library/mt253492.aspx
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.