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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
RobertO995
Frequent Visitor

list max

Hello all,

 

I need your help with List.Max in PowerBi. I'm totally new in M language and even simply things make a lot of troubles for me.

 

I have separated columns with date and year. For example: one column is 01/01/2018 and second is just 2018. In my table I have dates from 2017 to 2019 and I want to create another column with the maximum year in every row - so in this case, every row (in dates from 2017 to 2019) will be 2019, in the next year it will be 2020 (this is because I'm using operational years instead of calendar).

 

I guess, I need to use List.Max function, but got some issues with that. 

 

If I try List.Max([Year column]) - I received "Cannot convert 2019 value to List type,

If I try List.Max[Year column] - I received "Cannot use access to filed for type Function"

 

The only way, I received what I want was to copy the whole table, match column with year, click 'convert to list' button, and then add another column and use List.Max function, but I have a few questions:

 

1) will this list refresh automatically if the new dates will appear?

2) Is there simplier way to receive max year in another column in every row?

 

Thanks in advance!

 

 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@RobertO995

 

Hi,

 

Just add the previous step reference in your List.Max function

 

for example

 

List.Max(#"Changed Type"[Year])

listmax.png

View solution in original post

1 REPLY 1
Zubair_Muhammad
Community Champion
Community Champion

@RobertO995

 

Hi,

 

Just add the previous step reference in your List.Max function

 

for example

 

List.Max(#"Changed Type"[Year])

listmax.png

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.