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

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.

Reply
Asantos2020
Advocate II
Advocate II

Passing Query Parameter in a json url not working

Hello,

 

I've been trying to pass a parameter in a json url to have the FromDate back to 04 months, for example, but it keeps bringing the whole year.

 

initialDate="&Date.ToText(DateTime.Date(Date.AddMonths(DateTime.LocalNow(), -MonthParameter)))

 

It results in the correct date, but I guess there is something wrong with the format it's brought in: 29/07/2019, while the original, static date was yyyy-MM-dd. 

 

Any help will be appreciated.

 

Cheers,

Antonio

1 ACCEPTED SOLUTION
Asantos2020
Advocate II
Advocate II

...it really turned out to be a formatting issue. The date had then to be like the following:

 

dataInicial="&Date.ToText(DateTime.Date(Date.AddMonths(DateTime.LocalNow(), -MonthParameter)), "yyyy-MM-dd")&...

 

...thanks to @beginner coder on stackoverflow.

 

Cheers,

Antonio

View solution in original post

2 REPLIES 2
Asantos2020
Advocate II
Advocate II

...it really turned out to be a formatting issue. The date had then to be like the following:

 

dataInicial="&Date.ToText(DateTime.Date(Date.AddMonths(DateTime.LocalNow(), -MonthParameter)), "yyyy-MM-dd")&...

 

...thanks to @beginner coder on stackoverflow.

 

Cheers,

Antonio

Hi @Asantos2020 ,


Glad to hear that you have resolved your problem. Would you please kindly mark your sharing solution as an answer so that it can benefit more users?

 

Please do not hesitate to ask here if you have any further question.


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.