Forum Discussion
Else if function displaying the max date
- 6 years ago
Hi Anonymous ,
M language is based on the row levels to get the maximum of a column for example as you refer you need to pick up the List.Max.
Assuming that you want to pick up the maximum value of the duration column you need to do your column like:
= Table.AddColumn(Between, "Column", each if [Duration] >= 60 then "60 to " & Number.ToText (List.Max(#"PreviousStepName"[Duration])) else if [Duration] >= 30 then "30 to 59" else if [Duration] >= 11 then "11 to 29" else "0 to 10")I'm assuming that your duration column is in number format that is why we need to use the Number.ToText.
Also using the List.Max you need to reference the step you want to calculate the maximum and the column thats the part
List.Max(#"PreviousStepName"[Duration])
Hi Anonymous ,
M language is based on the row levels to get the maximum of a column for example as you refer you need to pick up the List.Max.
Assuming that you want to pick up the maximum value of the duration column you need to do your column like:
= Table.AddColumn(Between, "Column", each if [Duration] >= 60 then "60 to " &
Number.ToText (List.Max(#"PreviousStepName"[Duration])) else if [Duration] >= 30 then "30 to 59" else if [Duration] >= 11 then "11 to 29" else "0 to 10")
I'm assuming that your duration column is in number format that is why we need to use the Number.ToText.
Also using the List.Max you need to reference the step you want to calculate the maximum and the column thats the part
List.Max(#"PreviousStepName"[Duration])
- Anonymous6 years agoNot applicable
MFelix well knock me down and call me Aunt Sally. This worked. Thank you!