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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to count all 0's and 1's

Hi all,

 

I have an excel spreadsheet and I want to count al 0's and 1's seperate. The data is from a survey and 0 = no, 1 = yes.

Here is an example of the data:

shockl1ne_0-1605874117003.png

Now if I try to visualize it, PowerBI doesn't count the 0's.

shockl1ne_1-1605874154712.png

Is there a way to set this as a boolean or something?

Thanks!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I guess you selected sum not to count

remyo_1-1605874937197.png

View solution in original post

3 REPLIES 3
v-xuding-msft
Community Support
Community Support

Hi @Anonymous 

 

v-xuding-msft_0-1606125671361.png

 

 

In order to solve the problem, you need to do like this.

  • v-xuding-msft_1-1606125671372.png
  •  

    6.png

     

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I guess you selected sum not to count

remyo_1-1605874937197.png

ibarrau
Super User
Super User

Hi, you can do it in many ways depending on how you will design the page.

One way should be creating a measure COUNTROWS( 'Table' ). You can use that measure in a visualization and the column with 0 and 1 as filter (slicer) for the visualization.

If you want to keep the number static you can build a measure for that specific scenario like:

Measure column1 when 0 =
CALCULATE(
    COUNTROWS( Table ) 
    , Table[Column1] = 0
)

That second way will always show the total result of that column for 0.

 

Hope this helps,


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

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors