Forum Discussion

shermayne123's avatar
shermayne123
Icon for Helper I rankHelper I
4 years ago
Solved

Filter Matrix for 1 column

Hi,   I've created a Matrix visualization for 3 survey questions with percentages for Agree/Strongly Agree and Others responses. I added Question to the Rows, Reclassified Responses to the Columns ...
  • v-yadongf-msft's avatar
    4 years ago

    Hi shermayne123 ,

     

    This is my test table:

     

    Please try following measure to create a new column:

    Percentage = 
    var _count =  CALCULATE(COUNT('Table'[Reclassified Responses]),FILTER('Table','Table'[Question]=EARLIER('Table'[Question]) && 'Table'[Reclassified Responses] = EARLIER('Table'[Reclassified Responses])))
    var _allcount = COUNTX(FILTER('Table','Table'[Question] = EARLIER('Table'[Question])),'Table'[Reclassified Responses])
    return
    DIVIDE(_count,_allcount)

     

    Create a matrix visual:

    After filtering:

     

    Please refer the attached pbix file.

     

    Best regards,

    Yadong Fang

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