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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
InfiniteSheldon
Frequent Visitor

Dates Misalign with the Data Points on the Line Chart

Can anyone please tell me why the data points misalign with the month end dates on my line chart? When I show it as a table, everything looks correct. Please let me know how to fix this issue. Thanks! 

 

InfiniteSheldon_0-1718215371819.png

 

1 ACCEPTED SOLUTION

Make sure your Date Dimension table has the following columns:

 

Month_Year =  FORMAT(Date_Table[Date], "mmm yyyy")

End_of_Month = EOMONTH(Date_Table[DATE], 0)

 

Then sort "Month_Year" by "End_of_Month".  (Sort by column option in table view).  This will help you ensure that your X axis is sorted properly.

 

Then use the "Month_Year" column as your x-axis value, instead of "Month Ending".  Now you might be able to choose "continuous" and have it not look strange.  Let me know if this helps.

View solution in original post

4 REPLIES 4
kpost
Super User
Super User

When you think about it, June 30th 2023 SHOULD actually be displaying as immediately prior to the beginning of July 2023.  The graph is not actually displaying anything incorrectly.

 

But if it bothers you being presented this way, and you are okay with every month being labeled, you can fix it by changing the X axis to "Categorical" rather than "Continuous".

 

///Mediocre power bi advice, but it's free///

Thank you. But if change it to "Categorical", the "Forecast" function won't be available any more under the Analytics. 

InfiniteSheldon_0-1718221129964.png

 

Make sure your Date Dimension table has the following columns:

 

Month_Year =  FORMAT(Date_Table[Date], "mmm yyyy")

End_of_Month = EOMONTH(Date_Table[DATE], 0)

 

Then sort "Month_Year" by "End_of_Month".  (Sort by column option in table view).  This will help you ensure that your X axis is sorted properly.

 

Then use the "Month_Year" column as your x-axis value, instead of "Month Ending".  Now you might be able to choose "continuous" and have it not look strange.  Let me know if this helps.

Thank you very much. The line chart does look correct following the steps above. It's very interesting to see that you can actually sort the "Month_Year" column by "End_of_Month" columns, even if the "End_of_Month" column contains duplicated records. Previously, I thought that you could only select "Sort by column" if that column contains unique data. 

 

However, the option to toggle X-axis between continuous and categorical is missing, and I am still not able to forecast anything. Oh well, I don't see a better way at the moment, so I will accept it as the solution. Thank you again!  

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.