Creating a % column on Matrix


What do you think is the best way to create a column which gives a % based on what's in a matrix?

I have customer down the left, and a yes/no along the top, I then want to add a column that will give how many 'yes's as a % of the total. I tried the following but I know this doesn't work and have finally worked out why:

,(CASE WHEN Roles.Description = 'Yes' THEN 1 ELSE 0 END) / (CASE WHEN Roles.Description = 'Yes' THEN 1 ELSE 1 END) AS [%]

Is it something I should do in the query or in the table (expression)

Thank you!


looking at this 2 things come to mind

please investigate

  1. pivot

  2. sum ( case )


please let me know if you need anything

Please provide sample data