Line Chart shows area for years with no data

Hi all,

This one’s easy to spot. The top line chart I have used the continuous [date] field from the date table. The line chart below I have used the [year] field from the date table.

Notice on the chart below (where I have circled in red with a question mark) the gap. Don’t know why this is happening, any ideas?

I’d like to show the chart starting at year 1995, when the data starts but only by year, not with the lines up and down like on the chart on top that you get with the continuous date range.

Never seen this issue before, it’s a big data set, this may have something to do with it?

Attached is my file
Crime NSW.pbix (6.5 MB)

Thanks,
Tim

Hello @Timmay,

Thank You for posting your query onto the Forum.

Well, since the X-Axis is set to a “Continuous” type, Power BI broke out the axis in the multiples of 5 years, in this case. So if you see, you had a last data on “1st Dec, 2019” still it showcased end year as 2020 and same happened with the start year as well.

And it’s a simple fix. Just select the chart and go to the X-Axis option. And under the range section, input the minimum value as 1995 i.e., the starting year of the first data point. Below are the screenshots provided for the reference -

Minimum Range Value

I’m also attaching the working of the PBIX file for the reference purposes.

Hoping you find this useful and meets your requirements that you’ve been looking for.

Thanks and Warm Regards,
Harsh

Crime NSW - Harsh.pbix (6.5 MB)

2 Likes

Thanks Harsh, very helpful.

Also explains why I couldn’t see the options for sort axis in the top right hand corner.

Cheers,
Tim