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
Digger
Post Patron
Post Patron

Incremental refresh date parameter to ISO 8601

How to convert Incremental refresh date parameter to ISO 8601?
Date must be provided ISO 8601 (e.g.2020-01-08T11:17:20Z)


i have  webcontents parameters
,Query=
[
from = Date.ToText(RangeStart), // This produce errror
till = Date.ToText(DateTime.Date(Date.AddMonths(DateTime.LocalNow(),0)), "yyyy-MM-dd") //NOW

]

error
Expression.Error: We cannot convert the value #datetime(2022, 1, 1, 0, 0, 0) to type Date.
Details:
Value=2022-01-01 00:00:00
Type=[Type]

But if i use from = Date.ToText(DateTime.Date(RangeStart), "yyyy-MM-ddThh:mm:ssZ")

i got error DataSource.Error: Web.Contents failed to get contents from 

i think this is beacause of escape : to %3A in parameter &from=2022-01-01T12%3A00%3A00Z&till=2022-03-22

 

so how to avoid %3A

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Digger ,

 

Have you tried this?

Icey_0-1648175351682.png

 

Reference: 

DateTimeZone.ToText - PowerQuery M | Microsoft Docs

Convert DateTime to ISO 8601 date and time strings in Power Query – (thebiccountant.com)

 

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Icey
Community Support
Community Support

Hi @Digger ,

 

Have you tried this?

Icey_0-1648175351682.png

 

Reference: 

DateTimeZone.ToText - PowerQuery M | Microsoft Docs

Convert DateTime to ISO 8601 date and time strings in Power Query – (thebiccountant.com)

 

 

 

Best Regards,

Icey

 

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.