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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
gmoore7
Frequent Visitor

Dataflow Gen2 Max Effective Date as Parameter

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"}

Dataflow.png

 

Is what I am doing not supported or did I do something wrong?

Here is the advanced editor text for first and 2nd steps:

let
  Source = Sql.Database("Link to Lakehouse", "Lakehouse"),
  #"Navigation 1" = Source{[Schema = "dbo", Item = "view1"]}[Data],
  #"Changed column type" = Table.TransformColumnTypes(#"Navigation 1", {{"maxeffdate", type date}}),
  #"Drill down" = #"Changed column type"[maxeffdate],
  #"Calculated maximum" = List.Max(#"Drill down")
in
  #"Calculated maximum"

...and the 2nd step:

let
  Source = Sql.Database("SQL Server", "Database"),
  #"Navigation 1" = Source{[Schema = "dbo", Item = "table"]}[Data],
  #"Changed column type" = Table.TransformColumnTypes(#"Navigation 1", {{"effdate", type date}}),
  #"Filtered rows" = Table.SelectRows(#"Changed column type", each [effdate] > MaxEffDate)
in
  #"Filtered rows"


1 ACCEPTED SOLUTION
miguel
Community Admin
Community Admin

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.

View solution in original post

3 REPLIES 3
gmoore7
Frequent Visitor

Thanks! That did the trick!

Anonymous
Not applicable

Hi @gmoore7 
Glad that your query got resolved. Please continue using Fabric Community for any help regarding your queries.

miguel
Community Admin
Community Admin

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.

Helpful resources

Announcements
September Fabric Update Carousel

Fabric Monthly Update - September 2025

Check out the September 2025 Fabric 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.