Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Matrix total - turn into %

I have a matrix created where I have a Score column that contains Met and Not Met.  The counts look good but I would like to have the total be a % of the Met.  I'm assuming I need to create a measure...
  • v-lili6-msft's avatar
    7 years ago

    hi, Anonymous 

    Based on my research, You could try this way as below:

    Step1:

    Create a dim Score table like this:

    Add an additional value "A" in it.

    Step2:

    Create the relationship between them as below:

    Step3:

    Create a measure like this

    Measure 2 = 
    IF (
        CALCULATE ( MIN ( 'Dim'[Score] ) ) = "A",
        FORMAT (
            DIVIDE (
                CALCULATE ( COUNTA ( 'Table'[Score] ), 'Table'[Score] = "Met" ),
                CALCULATE ( COUNTA ( 'Table'[Score] ) )
            ),
            "Percent"
        ),
        CALCULATE ( COUNTA ( 'Table'[Score] ) )
    )

    Step4:

    Drag Score from dim table and measure into matrix visual

    Result:

    and here is pbix file, please try it.

     

    Best Regards,

    Lin