Missing and Extra Months on X-Axis in Line Chart Visualization

Hello,

Issue:

We’re facing an issue with the line chart where not all months are displayed on the X-axis. Additionally, some months appear on the axis even when no data exists for them.

For example, as shown in the image below, May 2024 has valid data points but doesn’t appear on the X-axis, while October 2024 and January 2025—which have no data—are still being displayed.

For instance, October 2024 and January 2025 appear on the graph even though they aren’t present in the above data. On the other hand, May 2024 (and a few other months) have data values, but their month names are not displayed on the X-axis. When we hover over those points, the data appears — however, the corresponding month labels remain missing from the axis.

Below are the calculated fields used for this setup :

Rolling 12M Period is :

ifelse(

Date >= truncDate(‘MM’, addDateTime(-12,‘MM’, now())) and Date < now(),

‘Last 12 Months’,

ifelse(

Date >= truncDate('MM', addDateTime(-24,'MM', now())) 

  and Date < truncDate('MM', addDateTime(-12,'MM', now())),

'Previous 12 Months',

NULL

)

)

Dynamic Share is :

ifelse(${DynamicShare}=“Unit”,{Unit Monthly Share}, {Dollar Monthly Share})

Where

Unit Monthly Share is :

{Sum of Units} / sumOver({Sum of Units}, [Date])

Sum of Units is :

sum(units)

similarly for dollars

Retailer and Date are dataset level field.

This is how the setup Looks like :

last 12 M Vs previous 12 Months refers to the Rolling 12M period calculated field.

Note :- If we do something like below from visual properties then all months being displayed but with the gap and if we disable date gaps then it get back to the setup like above image.

Regards,

Soham.

Hi @soham,

To my understanding, there is no feature that allows you to pick specific values within your x-axis for which labels to hide and show.
Looking at your example, by default it looks like QuickSight automatically shows specific values on your x-axis based around a pattern. For instance, the first two months and last two months are shown, then there’s a two month gap on each side followed by another two month gap on each side. So my assumption is that if all values cannot fit on your x-axis with the desired layout, then it follows some type of symmetrical notation, creating the same size and number of gaps on either side from the middle.
I believe the only work around for the time being would be to change your layout to be at an angle, that way it can show all of your months. (Or maybe you could try setting up a filter to filter out months that equal ‘zero sales’). Although since you’re using a time window as your x-axis, this may not be a plausible fix in your instance.
Either way, I’ll mark this as a feature request because I agree that this would be a useful feature to have implemented.

Thank you

1 Like

Hello @Brett

Thank you so much for the detailed explanation and marking this as a feature request.

I have created logic something like below where visual and date filer split in two spans one for previous and other for latest months and it fixed the issue for now :

Regards,

Soham.

1 Like