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
Sergec67
Frequent Visitor

Operators in Power Query M

Hi,

 

I can use the operators = and <> between two dates.  But I get an error when I use <, >, >= or <=.  I have both my fields are a Date data type.  

 

Expression.Error: We cannot apply operator < to types List and Date.
Details:
Operator=<
Left=[List]
Right=2021-05-31

 

 

1 ACCEPTED SOLUTION

 

Are you trying to apply this comparison across different tables? If you are then, yes, you will need to provide row context for the calculation for the remote table.

If you're making the comparison across two columns in the same table then the row context should be implicit, and there's another issue at play.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

3 REPLIES 3
BA_Pete
Super User
Super User

Hi @Sergec67 ,

 

Power Query quite clearly thinks that one of your dates is actually a list:

 

BA_Pete_0-1666793638103.png

 

You need to ensure that both columns only contain dates in every row.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Every row only have dates.

I think I found my problem. Even if it's a table containing only one row, I still need to identify that row. Without identifying the row it reads it has a list.

Thanks

 

Are you trying to apply this comparison across different tables? If you are then, yes, you will need to provide row context for the calculation for the remote table.

If you're making the comparison across two columns in the same table then the row context should be implicit, and there's another issue at play.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




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.

Top Solution Authors