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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
daryllabar
Regular Visitor

How to Display the Percentage of Boolean Values for Multiple Fields in One Visualization

I have a around 20 columns in my table, that are true/false values.  I want to display the true percentages for each column in a single visulization. Is this possible, if so how?

 

For example:

 

AsOfDateOption AOption BOption COption DOption EOption FOption G
1/1/20201011111
1/2/20201011111
1/3/20201011111
1/4/20201011111
1/5/20201011111
1/6/20201001111
1/7/20201001110
1/8/20201001100
1/9/20201001000
1/10/20201000000

 

 

Option A: 100%

Option B: 0%

Option C: 50%

Option D; 90%

Option E: 80%

Option F: 70%

Option G: 60%

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@daryllabar , first unpivot

https://radacad.com/pivot-and-unpivot-with-power-bi
Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/

 

After that with new option column

try this divide(sum(Table[Option]),count(Table[Option]))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@daryllabar , first unpivot

https://radacad.com/pivot-and-unpivot-with-power-bi
Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/

 

After that with new option column

try this divide(sum(Table[Option]),count(Table[Option]))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

After I unpivoted, I just select a bar chart and added the values column to it, sand selected Average for the column and that did what I want.  Although I wish the label would be 95% rather than .95, but it works!

After the Unpivot, I have 500k rows.  I'm guessing that should not be transposed, since that will creat 500k columns, or am I misunderstanding it?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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