Forum Discussion

Lonefish's avatar
Lonefish
New Member
10 years ago
Solved

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 ...
  • KGrice's avatar
    10 years ago

    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.