Forum Discussion

CMoppet's avatar
CMoppet
Icon for Helper IV rankHelper IV
2 years ago
Solved

Simplifying three measures in to one

Hello,   I have a column of “Yes” and “No” values and I am trying to write a measure to tell me what percentage of the column’s values are “Yes”.  I’ve managed to do this by writing three measures,...
  • rbriga's avatar
    2 years ago

    Use variables, and simplify a bit:

    Effectiveness=
    VAR _Rows = 
    CALCULATE(
     COUNTROWS( 'WO Raw Data'),
     KEEPFILTERS ('WO Raw Data'[Machine Brand] = "Link")
    )
    
    VAR _Effective = 
    CALCULATE(
     COUNTROWS( 'WO Raw Data'),
     KEEPFILTERS ('WO Raw Data'[Machine Brand] = "Link"),
     KEEPFILTERS ('WO Raw Data'[Eff 90D?] = "Yes")
    )
    
    RETURN
    DIVIDE( _Effective , _Rows )