Forum Discussion

Tob_P's avatar
Tob_P
Icon for Helper V rankHelper V
2 years ago

Calculating % from Unpivoted Data

Hi all,

 

I'm pulling together survey responses, a number of questions are a Yes/No response and I have data from the previous year that I'd like to compare to. I managed to convert the number of responses into a % using the following DAX...

 

Yes/No % =
VAR _1 = COUNT(Tbl_Responses[Response])
VAR _2 = CALCULATE(COUNT(Tbl_Responses[Response]),
         FILTER(ALLSELECTED(Tbl_Responses), Tbl_Responses[Date] = MIN(Tbl_Responses[Date])))
RETURN
_1/_2

 

...which has worked well in a clustered column chart...

...however my preference would be to have it in a Matrix, however when using the same DAX, I get the following...

Changing the % to % of overall total, row total and column total obviously throw it out even more, so I'd like to know if it's possible (and how) to amend that DAX so that I can replicate the correct % displayed in the Clustered Column chart?

1 Reply