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
Lonefish
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
KGrice
Memorable Member
Memorable Member

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

4 REPLIES 4
sudhakarsha
Regular Visitor

Simply apply the filter on the Line chart to show Non-blanks. That will exclude all the dates without value.

Hi do you know if there is any current solution for this? I am stucked on a business requirement on this feature

cyclist007
Responsive Resident
Responsive Resident

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)

KGrice
Memorable Member
Memorable Member

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.

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.