Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
rajudoc
Frequent Visitor

How to calculate percentage of total for unpivoted selected columns

Hello!

I am having trouble in calculating percentage of total for columns after upivoting. I have unpivoted selected columns (leaving unique id column) having 'YES' or 'NO' attribute (YES =1, NO=0).

 

After unpivoiting of selected columnsAfter unpivoiting of selected columns

When I pulled the value to Matrix visualization, it's showing the percentage of the attribute (morbidity_type) total (2165). What I need is to calculate the percentage of 'morbidity_type' from total number of enteries (here it is 3980 as shown below)

Morbitidy.PNG

"Total" is a measure.

What I want here is percentage from 'Total" enrolled babies and not just "morbidity_type" total. Could anyone of you know how to do this? Please help. Thanks in advance!

Regards,

Raj

2 ACCEPTED SOLUTIONS
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @rajudoc,

 

If I understand you correctly, you should be able to use the formula below to create a new measure to calculate the percentage from 'Total" enrolled babies. And show the new created measure on your Matrix visualization. Smiley Happy

Percentage of Morbidity = DIVIDE ( COUNT ( 'Table1'[Number] ), [Total] )

Note: Just replace 'Table1' with your real table name.

 

Regards

View solution in original post

Iadem
Frequent Visitor

If I understand you correctly,

 

You need divide "YES" by all count. You can use for this next meeasure

Test = DIVIDE ( COUNT ( 'Table1'[Number] ), calculate([Total],all('Table1' )))

 

View solution in original post

4 REPLIES 4
Iadem
Frequent Visitor

If I understand you correctly,

 

You need divide "YES" by all count. You can use for this next meeasure

Test = DIVIDE ( COUNT ( 'Table1'[Number] ), calculate([Total],all('Table1' )))

 

rajudoc
Frequent Visitor

Even this measure also works! Thanks a lot sirSmiley Wink

v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @rajudoc,

 

If I understand you correctly, you should be able to use the formula below to create a new measure to calculate the percentage from 'Total" enrolled babies. And show the new created measure on your Matrix visualization. Smiley Happy

Percentage of Morbidity = DIVIDE ( COUNT ( 'Table1'[Number] ), [Total] )

Note: Just replace 'Table1' with your real table name.

 

Regards

Worked like wonderSmiley Wink . Thanks a lot!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.