Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Calculations based on Conditional Calculated columns

I have a table that splits agents into productive and non-productive minutes using a calculated column.   The table visual can perform this split quite well, however, when I want to do calculations...
  • v-xicai's avatar
    5 years ago

    Hi Anonymous ,

     

    You may create measures like DAX below.

     

    Prod% =
    VAR _Prod =
        CALCULATE (
            SUM ( Table1[PeriodMins] ),
            FILTER ( Table1, Table1[ProductiveSplit] = "Prod" )
        )
    VAR _Total =
        CALCULATE ( SUM ( Table1[PeriodMins] ), ALLSELECTED ( Table1 ) )
    RETURN
        DIVIDE ( _Prod, _Total )
    
    
    
    
    Known% =
    VAR _Prod =
        CALCULATE (
            SUM ( Table1[PeriodMins] ),
            FILTER ( Table1, Table1[ProductiveSplit] = "Prod" )
        )
    VAR _Known =
        CALCULATE (
            SUM ( Table1[PeriodMins] ),
            FILTER ( Table1, Table1[ProductiveSplit] = "NP-Known" )
        )
    VAR _Total =
        CALCULATE ( SUM ( Table1[PeriodMins] ), ALLSELECTED ( Table1 ) )
    RETURN
        DIVIDE ( _Prod + _Total, _Total )
    

     

    Best Regards,

    Amy 

     

    Community Support Team _ Amy

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