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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Calculated percentage value for columns

Hello,

I have simplified the problem here where I want to represent this "Calculated Value" in a visual against the many different "Subjects". I don't want to calculate it in Excel but rather do it automatically in Power BI so as to keep the dashboard interactive.

 

TinyElephant_0-1671154216903.png

StudentSubject  ASubject  BSubject  X
Student 141.
Student 223.
Student 314.
Student 433.
Student 542.
Student 603.

 

The formula I'm using is calculating the percentage of occurrences of values 4 and 3 out of values 4, 3, and 2.

=(COUNTIF(B2:B7,4) + COUNTIF(B2:B7,3)) * 100 / (COUNTIF(B2:B7,4) + COUNTIF(B2:B7,3) + COUNTIF(B2:B7,2))


I have unpivoted the columns to represent the skills. 

TinyElephant_2-1671154831729.png


Please suggest how to calculate those values to make another visual that interacts with my existing one.

TinyElephant_1-1671154793888.png

 

1 ACCEPTED SOLUTION

@Anonymous Yes, you can pivot the data to have one column for  subject 

 

negi007_0-1671184662428.png

 

create a measure like below

Measure_SubA = CALCULATE(COUNT(tab_stud[Subject]),tab_stud[Skill_Level]=4 || tab_stud[Skill_Level]=3)/
CALCULATE(COUNT(tab_stud[Subject]),tab_stud[Skill_Level]=4 || tab_stud[Skill_Level]=3|| tab_stud[Skill_Level]=2)
 
 
negi007_1-1671184706273.png

 

pbix attached as well. 

 

FYI. if there is something which can be done easily in excel and data size is not too big then it would be advisable to use excel instead of powerbi. PowerBI can be used in situation where data is coming from different sources and some linking needs to be done. Also, cross filtering is one of the key feature of powerbi which can make easy to understand big data.




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

View solution in original post

3 REPLIES 3
negi007
Community Champion
Community Champion

@Anonymous  you can create a measure like below

 

Measure_SubA = CALCULATE(COUNT(tab_stud[Subject  A]),tab_stud[Subject  A]=4 || tab_stud[Subject  A]=3) /
CALCULATE(COUNT(tab_stud[Subject  A]),tab_stud[Subject  A]=4 || tab_stud[Subject  A]=3|| tab_stud[Subject  A]=2)
 



Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

Anonymous
Not applicable

The Student Data table is unpivoted now as seen in the image above. Do you want me to duplicate the original table to preserve Subject columns?
So, do I need to create this measure for each and every subject there is? Excel seems faster here as it already can have the calculated value using a formula. Is there any other benefit of dashboard interaction?

@Anonymous Yes, you can pivot the data to have one column for  subject 

 

negi007_0-1671184662428.png

 

create a measure like below

Measure_SubA = CALCULATE(COUNT(tab_stud[Subject]),tab_stud[Skill_Level]=4 || tab_stud[Skill_Level]=3)/
CALCULATE(COUNT(tab_stud[Subject]),tab_stud[Skill_Level]=4 || tab_stud[Skill_Level]=3|| tab_stud[Skill_Level]=2)
 
 
negi007_1-1671184706273.png

 

pbix attached as well. 

 

FYI. if there is something which can be done easily in excel and data size is not too big then it would be advisable to use excel instead of powerbi. PowerBI can be used in situation where data is coming from different sources and some linking needs to be done. Also, cross filtering is one of the key feature of powerbi which can make easy to understand big data.




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.