Forum Discussion

bdehning's avatar
bdehning
Post Prodigy
2 years ago
Solved

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
  • 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.

3 Replies