Forum Discussion
Dataflow Gen2 Input Parameter Issue with Date-Time value
- 1 year ago
Hi EricParvin,
Define your parameter as datetime in the dataflow, not text, if that’s how it’s used in M.
If you must use text, manually cast it to a datetime inside Power Query using DateTimeZone.FromText() or DateTime.FromText()
If your DateField is just datetime, strip the timezone from the parameter. This keeps the DateField type as datetime, and converts the parameter to match:
try below query i tried to repro:
let
Source = Table.FromRecords({
[ID = 1, DateField = #datetime(2025, 05, 21, 12, 0, 0)],
[ID = 2, DateField = #datetime(2025, 05, 21, 14, 0, 0)]
}),
DateTimeParsed = DateTime.From(DateTimeZone.FromText(DateTimeParam)),
Filtered = Table.SelectRows(Source, each [DateField] > DateTimeParsed)
in
FilteredThanks,
Prashanth Are
MS Fabric community support
Akash_Varuna The ISO 8601 standard is used in ODATA queries to for date-time values used in the filter clause. The dataflow gen2 also use the ISO 8601 standard in Power Query for the date-time clause in M code. The expectation is that a dataflow gen2 should accept the value 2025-05-27T14:00:00Z and parse the value correctly. I should not have to pass in a separate value for the date and time and combine in the M code.
Please let me know if you need further details. Thanks!
Hi EricParvin,
Define your parameter as datetime in the dataflow, not text, if that’s how it’s used in M.
If you must use text, manually cast it to a datetime inside Power Query using DateTimeZone.FromText() or DateTime.FromText()
If your DateField is just datetime, strip the timezone from the parameter. This keeps the DateField type as datetime, and converts the parameter to match:
try below query i tried to repro:
let
Source = Table.FromRecords({
[ID = 1, DateField = #datetime(2025, 05, 21, 12, 0, 0)],
[ID = 2, DateField = #datetime(2025, 05, 21, 14, 0, 0)]
}),
DateTimeParsed = DateTime.From(DateTimeZone.FromText(DateTimeParam)),
Filtered = Table.SelectRows(Source, each [DateField] > DateTimeParsed)
in
Filtered
Thanks,
Prashanth Are
MS Fabric community support
- EricParvin1 year agoMicrosoft Employee
As of now, input parameters for a dataflow gen2 do not allow for date/time type. I am limited to string.
I will try this suggestion to see if it makes a difference in the ODATA query.
- v-prasare1 year agoCommunity Support
@EricParvin, As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for your issue worked? or let us know if you need any further assistance here?
Thanks,
Prashanth Are
MS Fabric community support
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query