Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Check whether measure is higher or lower than average

I am trying to create a measure which is essentially a boolean that will return 1 if the SAS is above the average of the whole column.

 
SASAttachRate =
    DIVIDE (
        ( SUM ('User-based Products'[Total Quantity] ) - [HWV]),
        ( [Total Licences] - [HWV] ),
        0
    )
 
Average SAS = 
    AVERAGEX ( VALUES ('User-based Products'[Account Owner]), [SASAttachRate] )
 

Its returning all the rows as one when the rows which are less than 2.47% should return a 0. 

 

What do I need to alter in my checkSAS measure for it to ignore the other rows and simply look at the specific SASAttachRate for that individual and see whether it is below or above?

 
  • Hi, Anonymous 

     

    I'm not sure you've written your checkSAS measure here, but I'm guessing somewhere within it there will be a comparison like

    [SASAttachRate] <= [Average SAS]

     

    Can you try changing that part to 

    [SASAttachRate] <= CALCULATE( [Average SAS], ALL( 'User-based Products' ) ) 

     

    Have a quick look at what happens if you add [Average SAS] into the table you've shown. I'm thinking it will give you the same values as [SASAttachRate], because it's calculating the average of only one row, which is just the same value.

     

    Hope that helps, if it doesn't let me know.

1 Reply

  • AntonioM's avatar
    AntonioM
    Icon for Solution Sage rankSolution Sage

    Hi, Anonymous 

     

    I'm not sure you've written your checkSAS measure here, but I'm guessing somewhere within it there will be a comparison like

    [SASAttachRate] <= [Average SAS]

     

    Can you try changing that part to 

    [SASAttachRate] <= CALCULATE( [Average SAS], ALL( 'User-based Products' ) ) 

     

    Have a quick look at what happens if you add [Average SAS] into the table you've shown. I'm thinking it will give you the same values as [SASAttachRate], because it's calculating the average of only one row, which is just the same value.

     

    Hope that helps, if it doesn't let me know.