Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Max , minimum and average in a calculated column

Hi,

 

I have data in the below format,

 

Cost

100

2900

300

 

I need to create a column in such a way that, it should tell me the minimum, maximum and average of the cost column.

eg;

 

Cost    Custom_Column2

100            Minimum

2900          Maximum

300

 

How can I achieve this?

  • Hi Anonymous ,

     

    Not sure if I understand the question correctly, but you can try this:

    Column = IF('Table'[Cost]=MIN('Table'[Cost]),"Minimum",IF('Table'[Cost]=MAX('Table'[Cost]),"Maximum",IF('Table'[Cost]=AVERAGE('Table'[Cost]),"Average",BLANK())))
     
    Jori
     
    If I answered your question, please mark it as a solution to help other members find it more quickly.

2 Replies

  • jppv20's avatar
    jppv20
    Solution Sage

    Hi Anonymous ,

     

    Not sure if I understand the question correctly, but you can try this:

    Column = IF('Table'[Cost]=MIN('Table'[Cost]),"Minimum",IF('Table'[Cost]=MAX('Table'[Cost]),"Maximum",IF('Table'[Cost]=AVERAGE('Table'[Cost]),"Average",BLANK())))
     
    Jori
     
    If I answered your question, please mark it as a solution to help other members find it more quickly.
  • Hi Anonymous 

    You sure you need this in a column, rather than using measures?

    For example

     

    Minimum = MIN('Table'[Cost])
    Maximum = MAX('Table'[Cost])
    Average = AVERAGE('Table'[Cost])

     

    Regards

    Phil