Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi,
I have a Dataflow Gen2 where I am first querying the Max Effective Date from a table and then trying to use that as a parameter in a query later on in the flow (see screenshot).
I am running a query (that only returns one row with one column) and getting the date value from that row/column using an aggregation. I am then referencing that in the next query as a "reference query" value.
The preview in the 2nd step actually works and I can see my SQL Server receiving the date parameter correctly... and the data preview even populates on the 2nd step with only the data I need, but I keep getting the following mashup error when I publish and run:
We cannot apply operator #{0} to types #{1} and #{2}., Underlying error: We cannot apply operator < to types Table and Date. Details: Reason = Expression.Error;Message = We cannot apply operator < to types Table and Date.;Detail = [Operator = "<", Left = Table.FromRecords({}), Right = #date(2008, 10, 31)];Message.Format = We cannot apply operator #{0} to types #{1} and #{2}.;Message.Parameters = {"<", "Table", "Date"}
Is what I am doing not supported or did I do something wrong?
Here is the advanced editor text for first and 2nd steps:
Solved! Go to Solution.
Hi!
Is your first query being staged or not? If it set to be staged then that might be causing an issue as only tables can be staged and scalar values (like the one from a List.Max) will yield an error.
You can either set your first query to not be staged or change some components of your query so that the aggregation is perhaps done with a Group by and then you do a drill down in the second query to the Max value that you're looking for from the field that you require.
Thanks! That did the trick!
Hi @gmoore7
Glad that your query got resolved. Please continue using Fabric Community for any help regarding your queries.
Hi!
Is your first query being staged or not? If it set to be staged then that might be causing an issue as only tables can be staged and scalar values (like the one from a List.Max) will yield an error.
You can either set your first query to not be staged or change some components of your query so that the aggregation is perhaps done with a Group by and then you do a drill down in the second query to the Max value that you're looking for from the field that you require.