Forum Discussion
list max - function doesn't work properly
- 7 years ago
You can refer to the Year column of the table using the syntax PreviousStepName[Year], where PreviousStepName is the name of the step just before adding the Custom Column.
So in the Custom Column dialog box, the code would look like:
=List.Max( PreviousStepName[Year] )
Regards,
Owen
- 7 years ago
Hi RobertO995
You could take OwenAuger's advice, as tested, add a custom column using the following format
#"Changed Type" is the previous step
List.Max(#"Changed Type"[Year])
or write code in Advanced editor
= Table.AddColumn(#"Changed Type", "Custom", each List.Max(#"Changed Type"[Year]))
When i add year 2020 in my original table, then refresh from power bi desktop, it would automatically change to 2020 from 2019.
Best Regards
Maggie
You can refer to the Year column of the table using the syntax PreviousStepName[Year], where PreviousStepName is the name of the step just before adding the Custom Column.
So in the Custom Column dialog box, the code would look like:
=List.Max( PreviousStepName[Year] )
Regards,
Owen