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
bdehning
Post Prodigy
Post Prodigy

Count + 0

I have column chart by month year that works great when I use a Y-Axis Count Field.    

 

If I add a +0 to my count to account for 0 count months, I see 0 months going back to 1963.   I am trying to see most recent yeae data and maybe another year back.  I have filters for that.  

 

My filters to restrict years do nothing.   

 

What can I do as this is Count Measure - 

Count + 0 = CALCULATE(DISTINCTCOUNT(LossRun[Claim Number])) +0
1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @bdehning ,

 

Power BI treats 0 and blank differently.  If you add  0 to an aggregation, Power BI will show 0 for rows which values are supposed to be blank so, for example, the data doesn't in exist in Year 1963 until 1980, they will return 0 which may not be what you want. You must add a condition to your formula when to return 0. Example:

IF ( SELECTEDVALUE ( dates[year] >= 1990 ), [my measure] + 0 )

This WILL return at least 0 if the year is from 1990 onwards.





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

3 REPLIES 3
danextian
Super User
Super User

Hi @bdehning ,

 

Power BI treats 0 and blank differently.  If you add  0 to an aggregation, Power BI will show 0 for rows which values are supposed to be blank so, for example, the data doesn't in exist in Year 1963 until 1980, they will return 0 which may not be what you want. You must add a condition to your formula when to return 0. Example:

IF ( SELECTEDVALUE ( dates[year] >= 1990 ), [my measure] + 0 )

This WILL return at least 0 if the year is from 1990 onwards.





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.
Ashish_Mathur
Super User
Super User

Hi,

Why are your filters not working?  Also, you can simplify your measure to:

Measure = coalesce(DISTINCTCOUNT(LossRun[Claim Number]),0)


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ritaf1983
Super User
Super User

Hi @bdehning 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

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.

Top Solution Authors