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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Count the number of values on each column and create a column graph

Hello, I am tasked with building a dashboard and one of the items I'm struggling to add are the scorecard items. I am trying to create a columns graph that will show the number of "Non Compliant" occurences. My database is structured roughly like this:

 

Score IDQuestion 1 Question 2Question 3 
1234CompliantCompliantNon Compliant
5678Non CompliantCompliantCompliant
9012Non CompliantCompliantCompliant

 

And so on. Each response ID links to a database of operators, along with their final score. The final objective for this graph is that I can visualize the number of non-compliant responses for each item and filter it to my needs (time-based analysis etc). I have attempted multiple techniques and none reached the final objective. I figure this would be very easy to do in Excel with pivot tables, but I'm struggling a lot to create this in Power BI. I appreciate the help.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Try Unpivot function to transform your table.

vrzhoumsft_1-1703733176880.png

New Table:

vrzhoumsft_0-1703733151385.png

Then create a Stacked bar chart visual.

vrzhoumsft_2-1703733210327.png

 


Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

4 REPLIES 4
Fowmy
Super User
Super User

@Anonymous 

You need to unpivot your columns to use it in Power BI for proper visualization:

Refer this this video: https://www.youtube.com/watch?v=Vff2kRBM95o

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

I've attempted unpivoting the columns, but it messes the IDs. It basically stacks all the responses.

Anonymous
Not applicable

Hi @Anonymous ,

 

Try Unpivot function to transform your table.

vrzhoumsft_1-1703733176880.png

New Table:

vrzhoumsft_0-1703733151385.png

Then create a Stacked bar chart visual.

vrzhoumsft_2-1703733210327.png

 


Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

@Anonymous 

If you could share an Excel file with layout your have, I will be able to test it. share it through Google Drive link.  

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.