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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jamescosten
Helper I
Helper I

Measure to Count Distinct Values But Ignore 0

I have a chart that shows distint values but sometimes the value is 0. I want to exclude 0 from the count. How can I go about doing this?

2 ACCEPTED SOLUTIONS
ajohnso2
Super User
Super User

Hard to help without an example, have you considered creating your own column to count?

Something such as if(value > 0, 1, 0) aggregate this column to get your total

View solution in original post

danextian
Super User
Super User

Not stated whether the filter is to be applied to the same value column but try this:

CALCULATE ( DISTINCTCOUNT ( data[value] ), KEEPFILTERS ( data[value] <> 0 ) )




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
danextian
Super User
Super User

Not stated whether the filter is to be applied to the same value column but try this:

CALCULATE ( DISTINCTCOUNT ( data[value] ), KEEPFILTERS ( data[value] <> 0 ) )




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
ajohnso2
Super User
Super User

Hard to help without an example, have you considered creating your own column to count?

Something such as if(value > 0, 1, 0) aggregate this column to get your total

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