Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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!
Solved! Go to Solution.
Hi,
Just add the previous step reference in your List.Max function
for example
List.Max(#"Changed Type"[Year])
Hi,
Just add the previous step reference in your List.Max function
for example
List.Max(#"Changed Type"[Year])
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |