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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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.

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.
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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.