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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
andi2333
Helper I
Helper I

Cannot convert the value #date to type List

Hello,

I have a simple question for a simple query.

I would like to introduce a custom column B which shows "true" or "false" if the date in column A is the maximal value (aka newest date) available.

 

My query: 

if List.Max([Real Date])=[Real Date] then "TRUE" else "FALSE"

Howver, PQ tells me that "We cannot convert the value #date(2024, 1, 1) to type List.".

Still a bit new to PQ, but I figure this should be super simple to solve?

 

Thanks in advance.

2 ACCEPTED SOLUTIONS
BA_Pete
Super User
Super User

Hi @andi2333 ,

 

You're trying to evaluate the current row in a list context as you're applying your calculation to the current table (query step).

Try moving the max evaluation to the previous table/query step:

 

if List.Max([Real Date])=[Real Date] then "TRUE" else "FALSE"

// goes to:

if List.Max( PreviousStepName[Real Date]) = [Real Date] then "TRUE" else "FALSE"

 

You can actually simplify further by just using a logical expression:

 

List.Max( PreviousStepName[Real Date]) = [Real Date]

 

*BUMP* Repost as original apparently wasn't showing up.

 

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

Omid_Motamedise
Super User
Super User

in the case of using 

if List.Max([Real Date])=[Real Date] then "TRUE" else "FALSE"

the value of [Real Date] is not a list and is just a value in type date, if you want to refer to the whole column, you have to mention the name of previous step befor the name of column,

 

if the previous step is Source, rewrite the formula as 

List.Max(Source[Real Date])=[Real Date]

If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h

View solution in original post

2 REPLIES 2
Omid_Motamedise
Super User
Super User

in the case of using 

if List.Max([Real Date])=[Real Date] then "TRUE" else "FALSE"

the value of [Real Date] is not a list and is just a value in type date, if you want to refer to the whole column, you have to mention the name of previous step befor the name of column,

 

if the previous step is Source, rewrite the formula as 

List.Max(Source[Real Date])=[Real Date]

If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h
BA_Pete
Super User
Super User

Hi @andi2333 ,

 

You're trying to evaluate the current row in a list context as you're applying your calculation to the current table (query step).

Try moving the max evaluation to the previous table/query step:

 

if List.Max([Real Date])=[Real Date] then "TRUE" else "FALSE"

// goes to:

if List.Max( PreviousStepName[Real Date]) = [Real Date] then "TRUE" else "FALSE"

 

You can actually simplify further by just using a logical expression:

 

List.Max( PreviousStepName[Real Date]) = [Real Date]

 

*BUMP* Repost as original apparently wasn't showing up.

 

Pete



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

Proud to be a Datanaut!




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.