Forum Discussion

lcfaria's avatar
lcfaria
Helper II
3 years ago
Solved

How to get max value from different columns

Hi everyone,

 

I have a question regarding m language.

 

I have this table:

 

I need to find the max number of records regarding those 3 columns (Person, Unit and Location), so what I did was get the maximum number of records, using the function below for each column:

Then, I got the following result:

 

Now, I need to get the maximum number of these 3 columns as a scalar value. In the example above, the expected number would be 5.

 

I tried the formula below, but of course I need to look at all columns instead of just the Unit column:

 

Attaching the file, in case that helps with anything: https://1drv.ms/u/s!At5JlMR_naI1gf8GlIugbtzu09Vcfw?e=EqP1Ho

 

I appreciate your help on this topic. Thanks!

  • Hi,

    to obtain this (in my case 9 is maximum)

    You need to add a custom column

    List.Max({[Column1], [Column2], [Column3]})

    then List.MAx on your added column

    If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!

     

     

     

     

  • Anonymous's avatar
    Anonymous
    3 years ago

    serpiva64 already gave the answer to the question. 
    Just adding the photo to achieve the same requirement.


    Thank you.

4 Replies

  • Hi,

    to obtain this (in my case 9 is maximum)

    You need to add a custom column

    List.Max({[Column1], [Column2], [Column3]})

    then List.MAx on your added column

    If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!

     

     

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    serpiva64 already gave the answer to the question. 
    Just adding the photo to achieve the same requirement.


    Thank you.

    • lcfaria's avatar
      lcfaria
      Helper II

      Hi Anonymous thanks for complementing the answer!!!!