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! Learn more

Reply
Pricef1
Regular Visitor

How to count columns with numbers including 0, but don't count blank

I have been searching for over an hour and cant find the exact formula that will help. I am trying to calculate a total number of "trees" based on the information keyed into Sharepoint. Example of what I am using now: 

Total Trees Pulled = COUNT('SC87 Pet Treats Tear Down Trees'[Tree#1])*3
Pricef1_0-1686260300640.png

The concept was originally intended to have 3 "trees" per vat. We have updated our standards and now have to seperate the batches. So some may have 1,2,3 "trees" or have a 0 if there is no tag on particular tree, but need to count the 0 and not the blank. You will see from the information entered today total trees pulled is 21. In reality we have only pulled 17. I have also tried to divide it based on weight with each vat typically weighing around 300lbs. That didnt give me a true number either, but was closer to count. Any help would be greatly appreciated. 

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi, I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.

One of ways to solve this is to use == in the measure, instead of using only one = .

Jihwan_Kim_0-1686281162090.png

 

 

Item count version 2 (I want): = 
COUNTROWS (
    FILTER (
        VALUES ( Data[Item] ),
        NOT ( CALCULATE ( SUM ( Data[Value] ) ) == BLANK () )
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

It doesnt like values and sum. 

Pricef1_0-1686282944498.png

 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.