Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

IF STATEMENT BASED ON MAX VALUE

Hello,

 

I have created a measure which I thought calculated the max  from a caculated column however when I have written the measure and added it into a matrix or table under values I have the option to change the value to sum, average, min, max etc.  Once I have changed it to max, by results appear correct though.  

 

I need to sum the values in two of the column (My MAX - only when the value is set to MAX though) and sum it with Emp ID in the table visual but it doesn't return the expected results. 

 

My max meaure is:

 

MY MAX = CALCULATE(MAX('table'[Same Visit]),
ALLEXCEPT('table', 'table'[Company Name], 'table'[customer ID], 'table'[Emp ID]))
 
Note = The column - same visit is a calculated column. 
 
What I need to do it count the 'my max'column with the emp id and if over 10 return "good" else "requires improvement".
 
Unfortuantely due to data protection I can't sgare the file/data but this is a screesnshot of the table visual:
 

The two columns (results and if over 10 are what I am trying to acheive).

 

  • Anonymous 

    "My Max" is a calculated column and you have set the calculation to MAX . If you can share a sample file then it would be great.


4 Replies

  • Anonymous 

    "My Max" is a calculated column and you have set the calculation to MAX . If you can share a sample file then it would be great.


    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi @ Fowmy,

       

      unfortunately due to data protection I am unable to share the data. 

       

      I have created a measure to get the max based on a calculated and then used the ALL EXCEPT filter however although I have used the MAX function when I add it to a table visual it doesn't show the max, instead I have the option to get the average, min,max,standard deviation etc. Once I select MAX though and it gives me the results I require. From this calculation I now need to sum the rows for 2 columns when the values for "My Max" has been set to MAX.

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        I have managed to resolve this myself, no further assistance required for this query.