Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 months ago
Solved

X-axis formatting in Line chart

I have created a graph like this

Please can someone tell me if I can achieve an X-axis like below for the above graph

I tried creating in Date table a column with 'MMM-yy' format but as the number of dates are large between Jan 2022 and Jan 2026 I have a line chart like below. I dont want this tooggle bar

Can someone help me here please

  • Hi Anonymous

    The MMM-YY column is stored as text, so a continuous axis is not available. The closest alternative is to create a date column, such as an end-of-month or start-of-month value, for example using EOMONTH('TABLE'[DATE], 0).

    Some visuals do not respect the column’s formatting, which is why this is only the closest option. In the example shown, the End of Month column is formatted as MMM-YY, but the visual displays it differently, but instead of just year the X-axis now shows month and year.

     

     

3 Replies

  • Hi Anonymous

    The MMM-YY column is stored as text, so a continuous axis is not available. The closest alternative is to create a date column, such as an end-of-month or start-of-month value, for example using EOMONTH('TABLE'[DATE], 0).

    Some visuals do not respect the column’s formatting, which is why this is only the closest option. In the example shown, the End of Month column is formatted as MMM-YY, but the visual displays it differently, but instead of just year the X-axis now shows month and year.

     

     

  • Hi Anonymous 

    If you build a categorical X-axis based on a Month-Year field (for example MMM-YY from the calendar table), Power BI treats every month as a separate category.
    That means all months will be displayed, and there is no built-in way for Power BI to automatically skip labels on a categorical axis. This is why the axis becomes crowded when you have data from Jan-2022 to Jan-2026.

    You have a few practical alternatives:

    1. Use a continuous date axis
    ( like danextian  suggested)
    Instead of a Month-Year text column or the Date hierarchy, place a real Date column on the X-axis and set the axis type to Continuous.
    Power BI will then create a true time axis and automatically control label density, which avoids the clutter and removes the need for the scrollbar.

    2. Create a custom grouped time column
    Another option is to add a column in your calendar table that groups months based on business logic, for example:

    Start of quarter

    Every N months

    Custom fiscal or business periods

    Use this grouped column on the X-axis. This gives you control over how many labels appear, but it’s explained by design rather than a natural time scale.

    In short:

    A categorical month axis will always show all months.

    A continuous date axis is the cleanest solution for long time ranges.

    Custom grouping works when you want intentional, business-driven aggregation.

    There isn’t a native way to keep a categorical axis and automatically reduce the number of displayed months.

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    I do not want aggregation and neither the EOMONTH is working as it worked @danextian.
    But thank you.