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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Yvonne24
Frequent Visitor

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_0-1655814715008.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@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))

 

View solution in original post

2 REPLIES 2
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

Yvonne24_0-1655995051023.png

 

amitchandak
Super User
Super User

@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))

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors