cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Line chart - avoid plotting anything for NaN on a continuous x-axis

Hi, 

 

I have time series data, with occasional missing values or NaN's. 

 

I want to plot the data in a line chart, but do not want to plot anything when the data is either missing or a NaN. When using a continous x-axis, the line chart effectively interpolates by plotting a straight line between the times before and after. I want the line to be discontiuous in these cases. Can this be done in any way?

 

Setting the x-axis to categorical works, but also messes up the formatting of the labels. 

3 REPLIES 3
Highlighted
Super User IV
Super User IV

Re: Line chart - avoid plotting anything for NaN on a continuous x-axis

@mrtn , I think these are the only two options.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Community Support
Community Support

Re: Line chart - avoid plotting anything for NaN on a continuous x-axis

Hi, @mrtn 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

 

Table:

c1.png

 

You may set 'Type' for 'X-axis' as 'Categorical' and set 'Show items with no data' as on.

c2.png

 

c3.png

 

Result:

c4.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Helper I
Helper I

Re: Line chart - avoid plotting anything for NaN on a continuous x-axis

Hi @v-alq-msft,

 

thanks a lot for the input. 

 

The proposed solution  does not work in my case. 

 

The time stamps in my dataset are irregular, meaning that the interval between each measurement varies. The spacing of the points on the x-axis is not displayed correctly when selecting the 'Type' as 'Categorical'

 

 

Helpful resources

Announcements
Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors