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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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