Forum Discussion
Issue with Dataflow Gen2 with date variable
- 8 months ago
Hi RamonNooijen ,
The error message is actually giving the clue:
We cannot apply operator < to types Table and Date
That means WM is not a single date value at runtime – it’s still a table (or query result) when the dataflow engine tries to fold the query and push it to the Lakehouse / DW.
When you hard-code WM = #date(2025, 12, 3) it works, because WM is clearly a scalar date.
When you load it from SQL, your WM step is returning a table (for example one row, one column), not the cell value itself.You need one extra step to turn that table into a single date before using it in Table.SelectRows.
A common pattern looks like this in Power Query (M):
// Query that gets the watermark table from SQL
WMTable = Sql.Database("server", "db"){[Name="WatermarkTable"]}[Data],// Take the first row and the Watermark column as a scalar value
WM = Date.From( WMTable{0}[WatermarkDate] ),Then in your filter step:
FilteredRows =
Table.SelectRows(
IssuesTyped,
each [updated_at] >= WM
)Key idea:
WMTable = table returned from SQL
WM = single Date value extracted from that table
Right now you’re comparing [updated_at] (a date) to WM (a table), which is why you get the “Table and Date” error only when it actually runs in the service.
Once WM is a true date value, your dynamic filter will work the same way as the hard-coded example.
– Gopi Krishna
Hi RamonNooijen,
It looks like your WM is returning a table, not an individual value. so you're trying to compare a table with a date, and Power Query has no idea how to determine if a table is less than a date as those are two completely different datatypes.
If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.