cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Line graph draws line even when there's no data

I'm using Power BI to draw linegraphs of current measuring over time. There are however gaps in our data. Is it possible to delete te graph line where there's no data?

 

 

As you can see left and right there's data, but the blue (epic paint skills) part has no data. Is it possible that the line isn't there in big gaps?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Solution Sage
Solution Sage

I can't find a setting for it, and even forcing the measure to return BLANK when there is a 0 or no data doesn't do it. Some possible workarounds:

 

1. Change the X-Axis type to Categorical instead of Continuous. Dates without data won't show on the chart, but the downside is it's not obvious that any dates are missing, since they're all spaced equally without gaps.

2. Use a column chart instead. The gaps in data will show this way. If you still want a trend line, you can use the "Line and stacked column chart" and put the measure you want as both a line and column. Format the column color (under Data colors > Default Column Color) as something unobtrusive. You'll at least have a visual indication that there is no data if there is no bar, and you can see the line for trending.

3. Set your measure to return 0 for nulls. This will actually plot a 0, which could be really bad depending on your dataset. Don't want to confuse it with real values of 0 as opposed to gaps. But if it makes sense for your dataset, it makes the gap line up with the axis and is almost the same as not being there at all. Maybe even set it to -1 if you could have actual 0 amounts but not negative numbers in your data.

 

This sounds like a good candidate for an idea. Some kind of switch in the settings of a line chart for how to handle plotting nulls or 0s. All of the above options could cause confusion for users.

View solution in original post

2 REPLIES 2
Highlighted
Solution Sage
Solution Sage

I can't find a setting for it, and even forcing the measure to return BLANK when there is a 0 or no data doesn't do it. Some possible workarounds:

 

1. Change the X-Axis type to Categorical instead of Continuous. Dates without data won't show on the chart, but the downside is it's not obvious that any dates are missing, since they're all spaced equally without gaps.

2. Use a column chart instead. The gaps in data will show this way. If you still want a trend line, you can use the "Line and stacked column chart" and put the measure you want as both a line and column. Format the column color (under Data colors > Default Column Color) as something unobtrusive. You'll at least have a visual indication that there is no data if there is no bar, and you can see the line for trending.

3. Set your measure to return 0 for nulls. This will actually plot a 0, which could be really bad depending on your dataset. Don't want to confuse it with real values of 0 as opposed to gaps. But if it makes sense for your dataset, it makes the gap line up with the axis and is almost the same as not being there at all. Maybe even set it to -1 if you could have actual 0 amounts but not negative numbers in your data.

 

This sounds like a good candidate for an idea. Some kind of switch in the settings of a line chart for how to handle plotting nulls or 0s. All of the above options could cause confusion for users.

View solution in original post

Highlighted
Helper V
Helper V

Hi,

 

Did you find a solution to this or a better way to handle this? 
I also need a contiuous line chart (categorical does not help), and cant just plot the value as zero since its temperature (and actual value hovers around zero)

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors