This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
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.
Solved! Go to Solution.
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
Proud to be a Datanaut!
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]
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]
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
Proud to be a Datanaut!
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 1 |