Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
weilai0521
Frequent Visitor

Line break in line chart

 

Hi,

I have the following chart. For several lines, I do not have data points for certain years. For example, for the blue line, I only have the 2010 data point and then I have the data points from 2015-2017. Instead of a line, it would make much more sense to have a data point in 2010 and have the line from 2015-2017. Bascially, I need line breaks where I do not have data points. 

 

I did not find such option in the line chart. 

 

 

Capture.PNG

3 ACCEPTED SOLUTIONS

Hi @weilai0521 ,

 

Follow the steps below, then it will return the result you desired.

 

1.Set the X axis type to "Categorical" instead of "Continuous", which will make the "Show marker" button available.

 

1.png

 

 

 

 

 

 

 

 

 

 

2.Turn on the "Show marker" button .Select the Marker shape you prefer from the drop down. For further customization => Turn On => Customize Series or other  Customize shapes, size, color and so on.

 

2.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards,

Amy

 

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

View solution in original post

I really appreciate the help. 

 

I tried the categorical option but it gives me a graph like this. The year order mess up. Is there a solution for that? I tried to create a year_order variable and sort the year by year_order, which does not solve the problem. 

 

Thanks!

 

Capture.PNG

View solution in original post

Hi @weilai0521 ,

 

When I create the Year column from formula Year = YEAR(Sales[DateKey]), I can reproduce your scenario. I worked around this issue following steps below.

1.png2.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

While if you get the Year column from a date field, it won't have the issue.

 

3.png

 

 

 

 

Best Regards,

Amy

 

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

View solution in original post

6 REPLIES 6
sylvans
Advocate I
Advocate I

The solution here did not work for me. Rather, a simple DAX is able to resolve these broken lines but if there's a built-in formatting / solution, please let me know.

 

Count_of_Codes = 
    VAR var01_Count_of_Codes = COUNT('Dummy_FactTbl'[Dummy Code])
RETURN
    IF(var01_Count_of_Codes = 0,
        0,
        var01_Count_of_Codes
    )

 

v-xicai
Community Support
Community Support

Hi @weilai0521 ,

 

You can make some settings in Format pane like picture below .

 

2.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards,

Amy

 

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

 

I changed the line to dotted line. It is not helping. 

 

 

Capture.PNGCapture1.PNG

Hi @weilai0521 ,

 

Follow the steps below, then it will return the result you desired.

 

1.Set the X axis type to "Categorical" instead of "Continuous", which will make the "Show marker" button available.

 

1.png

 

 

 

 

 

 

 

 

 

 

2.Turn on the "Show marker" button .Select the Marker shape you prefer from the drop down. For further customization => Turn On => Customize Series or other  Customize shapes, size, color and so on.

 

2.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards,

Amy

 

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

I really appreciate the help. 

 

I tried the categorical option but it gives me a graph like this. The year order mess up. Is there a solution for that? I tried to create a year_order variable and sort the year by year_order, which does not solve the problem. 

 

Thanks!

 

Capture.PNG

Hi @weilai0521 ,

 

When I create the Year column from formula Year = YEAR(Sales[DateKey]), I can reproduce your scenario. I worked around this issue following steps below.

1.png2.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

While if you get the Year column from a date field, it won't have the issue.

 

3.png

 

 

 

 

Best Regards,

Amy

 

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors