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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors