cancel
Showing results for
Did you mean:
Helper I

## Calculate percentage of 100 for each category

Hi there.

I have a Power BI report where I would like to calculate the Percentage of 100 for each of the options against the category values (the 'Yes' and 'No' options) identified in the image below.

For example, calculate the percentage out of 100 for Option 1; calculate the percentage out of 100 for Option 2 ect...

Any help on this would be appreciated.

Thank you.

1 ACCEPTED SOLUTION
Super User

@PowerEnthusiast - this measure works. All it effectively does is puts a % value on your data.

``````Values =
VAR varNumerator = SUM('Table'[Value])
RETURN
DIVIDE(
varNumerator,
100
)``````

So 18 for option 1 become 18% as an example. If that isn't what you need, please explain what you are expecting the output to be.

Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling

Proud to be a Super User!

MCSA: BI Reporting
8 REPLIES 8
Super User

@PowerEnthusiast - this measure works. All it effectively does is puts a % value on your data.

``````Values =
VAR varNumerator = SUM('Table'[Value])
RETURN
DIVIDE(
varNumerator,
100
)``````

So 18 for option 1 become 18% as an example. If that isn't what you need, please explain what you are expecting the output to be.

Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling

Proud to be a Super User!

MCSA: BI Reporting
Super User

We would need data (see links below) to really help @PowerEnthusiast , but something along the lines of this would work for the No values, and a similar measure would work for Yes values.

``````Measure =
VAR varNumerator =
SUMX(
FILTER(
Table,
Table[Field] = "No"
),
Table[Value]
)
RETURN
DIVIDE(
varNumerator,
100
)
``````

How to provide sample data in the Power BI Forum

Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling

Proud to be a Super User!

MCSA: BI Reporting
Helper I

Thank you for the response.

The table looks like this:

Where there is an 'Options' table used for the x-axis.

Also, getting the percentages to visualise on a stacked chart - as shown in the initial image, would be ideal 🙂

Super User

Again @PowerEnthusiast - please see the links below for providing data. I'm not rekeying that in. Thanks!

How to provide sample data in the Power BI Forum

Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling

Proud to be a Super User!

MCSA: BI Reporting
Helper I

OptionsValueLegend

 Option 2 8 Yes Option 4 9 Yes Option 6 9 No Option 5 6 No Option 1 7 Yes Option 6 3 Yes Option 4 9 No Option 3 4 Yes Option 2 7 Yes Option 5 10 Yes Option 6 1 No Option 2 6 Yes Option 3 8 No Option 4 4 Yes Option 2 10 Yes Option 2 1 Yes Option 4 7 No Option 3 2 No Option 1 3 Yes Option 2 5 No Option 6 9 Yes Option 6 7 Yes Option 1 8 Yes Option 6 7 Yes Option 4 9 No Option 4 3 Yes Option 5 6 No Option 4 5 No Option 3 8 Yes
Helper I

This is the only way I could upload a sample set of the data.

Super User

Got it @PowerEnthusiast - let me play with it. 👍

Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling

Proud to be a Super User!

MCSA: BI Reporting
Helper I

Trying to add the table, but it's not allowing me to.

Announcements

#### Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

#### Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors
Top Kudoed Authors