Forum Discussion

bh_prism's avatar
bh_prism
New Member
6 years ago
Solved

Count True/False and represent in chart using percentage

Hey guys   Hopefully someone can help. I have two columns in a table which reports TRUE or FALSE based on criteria being met.   I wish to have the count of TRUE/FALSE and represent the difference...
  • Icey's avatar
    6 years ago

    Hi bh_prism ,

     

    If I understand you correctly, put the below measure into a card visual and you'll get what you want:

    TRUE/FALSE =
    VAR TRUE_ =
        CALCULATE ( COUNTROWS ( 'Table' ), 'Table'[Column1] = TRUE () )
            + CALCULATE ( COUNTROWS ( 'Table' ), 'Table'[Column2] = TRUE () )
    VAR FALSE_ =
        CALCULATE ( COUNTROWS ( 'Table' ), 'Table'[Column1] = FALSE () )
            + CALCULATE ( COUNTROWS ( 'Table' ), 'Table'[Column2] = FALSE () )
    VAR Total_ =
        COUNTROWS ( 'Table' ) * 2
    VAR TRUE_Percent =
        DIVIDE ( TRUE_, Total_, BLANK () )
    VAR FALSE_Percent =
        DIVIDE ( FALSE_, Total_, BLANK () )
    RETURN
        TRUE_Percent & " / " & FALSE_Percent
    

     

     

    Best Regards,

    Icey

     

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