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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
WLFRD
Helper III
Helper III

Stack sum of 0 and 1 in bar chart

Hello,

 

I would like to use a stacked bar chart to display the ratio between 0 and 1. I would like to use a date slicer to set the enter date. It has to count the 0 en 1 for the chosen period and show the sum of 0 and 1.

5fba2bd3-aa67-4f8b-b689-26319707af60.jpg

 

Result will look something like this:

Capture12.JPG

This is an example which I found on the internet.

 

I gave it a shot but it's not what I would to have:

Capture13.JPG

 

Capture14.JPG

 

So for the given time span based on the date slicer, the has to sum the 0's and 1's and stack them in a bar chart. 

 

How can I do this?

 

Thanks in advance.

 

Regards,

 

 

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @WLFRD ,

 

For this you need to make the countrows instead of the sum try using something similar to this:

 

Total 0 = COUNTROWS (FILTER(Table, Table[Column] = 0))
Total 1 = COUNTROWS (FILTER(Table, Table[Column] = 1))

 

Now use this two metrics on your visualization.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português





View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @WLFRD ,

 

For this you need to make the countrows instead of the sum try using something similar to this:

 

Total 0 = COUNTROWS (FILTER(Table, Table[Column] = 0))
Total 1 = COUNTROWS (FILTER(Table, Table[Column] = 1))

 

Now use this two metrics on your visualization.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português





Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.