Forum Discussion
Power Query: List.Max doesn't work on Date
- 8 years ago
Hi ovetteabejuela,
As I tested, you need to create the date column as a list, then use it in List.Max(). I have the following sample table.2. Create a custom column using the formula.
=List.Max(#"Changed Type"[Date])
3. You will get the expected result as follows.
Best Regards,
Angelia
Whats the context of the power query line of code? Are you passing a column or list type to the function? The error message reads like you have passed a since value of type Date.
- ovetteabejuela8 years agoImpactful Individual
So I added a column with this formula:
=List.Max([Date Column])
- v-huizhn-msft8 years agoMicrosoft Employee
Hi ovetteabejuela,
As I tested, you need to create the date column as a list, then use it in List.Max(). I have the following sample table.2. Create a custom column using the formula.
=List.Max(#"Changed Type"[Date])
3. You will get the expected result as follows.
Best Regards,
Angelia- KasparsT7 years agoRegular Visitor
Hi v-huizhn-msft!
But how to get max date for each Customer number if it have few of them?
Thanks
Kaspars
- Anonymous8 years agoNot applicable
So when you look at the actual code in the Advanced Editor, does this come after an 'each' statement? If so, you are passing a single value into that statement.
- MarcelBeug8 years agoCommunity Champion
The column name must be preceded by the table name, which can be either the name of another query or the name of another step in the current query.
=List.Max(Table[Date Column])