Forum Discussion
Line chart broken
- Anonymous1 year ago
Hi atoice ,
Considering the current limitations in sharing the dataset due to character constraints and security policies, I would recommend raising a support ticket. They will be able to assist you more effectively.
To raise a support ticket for Fabric and Power BI, kindly follow the steps outlined in the following guide:
How to create a Fabric and Power BI Support ticket - Power BI | Microsoft Learn
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thankyou.
Hi V-tsai,
I did try to add the formula you had. it did put zero line in. But it was still broken. It definitely is the calendar piece. But I did attempt to manually change "calendar month" to March, but thinking it's maybe because the week ending is in April. I did the same with the other breaks in the line to align the same months for those weeks. But it still didn't do it. It's something in how the calendar is aligned. I can't attached the file, or I would.
I appreciate your additional help.
Hi atoice ,
Based on what you described, the line chart breaks are due to how the calendar assigns weeks to months especially in cases where a week ends in a different month than most of its days.
To resolve this, I recommend reviewing your calendar logic to ensure that weeks are consistently attributed to the correct month either by using the week’s start date or basing it on most of the week’s days.
Avoid manually changing month labels, as this often leads to misalignment. Instead, define clear logic in Power Query or DAX when building your calendar. Also, make sure your chart uses the Date field from the calendar table as the X-axis and that the relationship to your fact table is properly set.
Enabling “Show items with no data” and wrapping your measure in COALESCE([Measure], 0) will help maintain line continuity once the calendar alignment is fixed.
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thankyou.
- atoice1 year agoFrequent Visitor
Hi v-tsai,
Thank you again for follow up. I don't know how to make a calendar in Power Query / Dax. I did use the formula, but it didn't work because of the calendar. In both ways, modifying the calendar to adjust for weeks 13, 26, 35, and 48 did not work. I can't paste the rows since it tells me I am over the character limit. I'm going to leave it as it with the team as that layout was the way they had it (in Excel). I just wanted to make it a little cleaner. I tried to take some snips with weeks in question (2023) and the comp week 13 for 2024.- Anonymous1 year agoNot applicable
Hi atoice
Thank you for the update, and I completely understand that adjusting weeks and months manually especially when dealing with edge cases like week-ending dates can be time-consuming.
To fully resolve the line breaks and ensure consistent plotting across all years, the most reliable approach is to use a dedicated Calendar Table in Power BI with consistent week and date alignment.
Since you mentioned you're not familiar with building one, here’s a ready-to-use Power Query script that you can paste directly into Power BI to generate a proper calendar:
To get started, open your Power BI Desktop file. Then, go to the Home tab and click on Transform Data this will open the Power Query Editor. Inside the editor, click on New Source and choose Blank Query. After that, open the Advanced Editor and paste the calendar script provided into the window. Once done, click Done and then Close & Apply to load the new calendar table into your model.
let StartDate = #date(2023,1,1), EndDate = #date(2025,12,31), DatesList = List.Dates(StartDate, Duration.Days(EndDate - StartDate) + 1, #duration(1,0,0,0)), TableDates = Table.FromList(DatesList, Splitter.SplitByNothing(), {"Calendar Date"}), AddYear = Table.AddColumn(TableDates, "Year", each Date.Year([Calendar Date])), AddMonth = Table.AddColumn(AddYear, "Calendar Month", each Date.ToText([Calendar Date], "MMM")), AddMonthNum = Table.AddColumn(AddMonth, "Month Number", each Date.Month([Calendar Date])), // Calculate Week Number based on ISO 8601 (week starts Monday) AddWeekNum = Table.AddColumn(AddMonthNum, "Calendar Week", each Date.WeekOfYear([Calendar Date], Day.Monday)), // Calculate Week Ending (Sunday) AddWeekEnd = Table.AddColumn(AddWeekNum, "Calendar WE", each Date.EndOfWeek([Calendar Date], Day.Sunday)), // Optionally add Month Quarter AddQuarter = Table.AddColumn(AddWeekEnd, "Calendar Month.Quarter", each "Qtr-" & Text.PadStart(Text.From(Date.QuarterOfYear([Calendar Date])),1,"0")), // Sort by date if needed SortedTable = Table.Sort(AddQuarter,{{"Calendar Date", Order.Ascending}}) in SortedTableAfter pasting the script, click Close & Apply to load the calendar. Then go to the Modeling tab, select Mark as Date Table, and choose the Calendar Date column. Lastly, link it to the date column in your sales table to ensure your visuals display correctly.
With this structure in place, your visuals should automatically align weeks consistently across all years, eliminating the breaks you're seeing especially in weeks like 13, 26, and 48.
Also, if your current layout is already accepted by your team and serves the intended purpose, your existing solution (continuous X-axis with small gaps) is perfectly valid.
I hope this will resolve your issue, if you need any further assistance, feel free to reach out.
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thankyou.
- Anonymous1 year agoNot applicable
Hi atoice ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.