Forum Discussion

Yvonne24's avatar
Yvonne24
Frequent Visitor
4 years ago
Solved

Line chart not showing zeros when count is zero

Hi all,

 

I am creating a line chart with a count of tickets on the y-axis and date on the x-axis.

With legend for different employees.

Not all employees are working on all days, so the count is sometimes blank/empty.

In the example below the lines are interupted with loose datapoint. .

 

How can I visualise these empty counts as 0, so the lines of the charts will not be interrupted.

I think it must be easy, but somehow I can't make it work.

 

Regards,

Yvonne

 

  • Yvonne24 , Add +0 to your measure

     

     

    or create a measure like an example 

    0 between range
    Measure = var _1= SUM(Opportunity[Opportunity count]) +0
    var _min = minx(ALLSELECTED('Calendar'), 'Calendar'[Date])
    var _max = maxx(ALLSELECTED('Calendar'), 'Calendar'[Date])
    return
    CALCULATE(if(max('Calendar'[Date]) <_min || max('Calendar'[Date]) >_max , BLANK(), _1))

     

2 Replies

  • Yvonne24 , Add +0 to your measure

     

     

    or create a measure like an example 

    0 between range
    Measure = var _1= SUM(Opportunity[Opportunity count]) +0
    var _min = minx(ALLSELECTED('Calendar'), 'Calendar'[Date])
    var _max = maxx(ALLSELECTED('Calendar'), 'Calendar'[Date])
    return
    CALCULATE(if(max('Calendar'[Date]) <_min || max('Calendar'[Date]) >_max , BLANK(), _1))

     

  • Yvonne24's avatar
    Yvonne24
    Frequent Visitor

    Hi,

     

    Thank you. However how do I insert this in my table/model?

    Sorry, I am not that experienced yet...

     

    As some of the dates/times are not in my data at all, for instance around midnight not al hours have a ticket. As my data sort of looks like this at night (see table). However during the day every (few) minutes a ticket comes in.

    So during nights, how so I implement the code you wrote?

     

    Regards,

    Yvonne