Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Measure for count

Hi I need a measure that will count. The column is sorted by colors (orange, yellow, blue, green). I need a measure that will count and add up all the blue and green and divide by the total number o...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    Try this meausre

    Measure = var _blue=CALCULATE(COUNT('Table'[Color]),FILTER(ALL('Table'),[Color]="Blue"))
    var _green=CALCULATE(COUNT('Table'[Color]),FILTER(ALL('Table'),[Color]="Green"))
    var _total=CALCULATE(COUNT('Table'[Color]),ALL('Table'))
    return DIVIDE(_blue+_green,_total)

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.