Calculating percentages by category

barbara_b

New Member
Joined
Oct 5, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Dear all,

First of all, thanks for taking the time to read my question :).

I have the following table:


ISO_codeQ7_1.primeministerQ7_1.othercentralgovagencyQ7_1.independentpublicQ7_1.subnationalgovQ7_1.judicialQ7_1.consulted_legislatureQ7_1.otherQ7_1.noneQ7_1.dontknowOGPOECDDocument Type
ARG
1​
1​
1​
1​
1​
1​
0​
0​
0​
OGPNON-OECDOGP/Open Government
ARG
1​
1​
1​
1​
1​
1​
0​
0​
0​
OGPNON-OECDOGP/Open Government
ARG
1​
1​
1​
1​
0​
0​
1​
0​
0​
OGPNON-OECDAnti-corruption/Integrity
ARM
0​
0​
1​
0​
0​
0​
0​
0​
0​
OGPNON-OECDOGP/Open Government
AUS
1​
1​
0​
0​
0​
0​
1​
0​
0​
Non-OGPOECDOGP/Open Government
AUS
0​
1​
0​
0​
0​
0​
0​
0​
0​
Non-OGPOECDDigitalisation/Digital government
AUS
0​
1​
0​
0​
0​
0​
0​
0​
0​
Non-OGPOECDOpen Data

I wanted to calculate the percentage of each answer to Q7_1 (e.g. prime minister) by document type (e.g. OGP/Open Government), so I produced the measure formula:

Q7. Central gov institutions = DIVIDE(CALCULATE(SUM('Multiple answer'[Q7_1.othercentralgovagency]),ALLEXCEPT('Multiple answer','Multiple answer'[Document Type])),CALCULATE(COUNTROWS('Multiple answer'),ALLEXCEPT('Multiple answer','Multiple answer'[Document Type])))

This works fine, it returns the percentage of "Q7_1.othercentralgovagency" (=1) over the total number of OGP/Open Government in my dataset.

However, since I used "ALLEXCEPT", when I try to filter values by the columns "OGP" or "OECD" from a slicer, the results do not change.

How can I ensure that my formula considers all other possible filters?

Thanks again!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,225,534
Messages
6,185,500
Members
453,298
Latest member
Adam1258

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top