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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Cadenze
Helper II
Helper II

Compress x-axis

I have searched the site and have found a few matches, but they are old and do not correspond to my PBI version. So here I am, asking a very simple question: how can I compress the x-axis, so I get a full months worth of data in the line chart visual without the scroll bar below? I do not have the option to put a zoom slider on the x-axis (only y) and I cannot change the minimum category width. It should be so simple, yet I have spent quite some time researching and experimenting. Any help would be greatly appreciated.

 

Linechart.png

1 ACCEPTED SOLUTION
WanderingBI
Resolver III
Resolver III

The cause is a bit hard to find without seeing your data model.

Could you post the data view of your table?

 

It looks like the issue is that the column that you are using for the "X-Axis" in the line chart is not a date column.

You need something like this:

2024/06/01

2024/06/02

...

formatted as "date type".

 

It looks like your column consists of the days of June ("1","2",...) so Power BI cannot know that it is a date. It will then just write them out in the visual without a way to group them together. It is the same as if you make a visual with  "a", "b", "c" as values for the x-axis.  

 

But it would be easier to diagnose when we could see your data model. You can blur the sensitive parts.

Please check that your date column is of data type "date" and not "text". 

View solution in original post

3 REPLIES 3
WanderingBI
Resolver III
Resolver III

The cause is a bit hard to find without seeing your data model.

Could you post the data view of your table?

 

It looks like the issue is that the column that you are using for the "X-Axis" in the line chart is not a date column.

You need something like this:

2024/06/01

2024/06/02

...

formatted as "date type".

 

It looks like your column consists of the days of June ("1","2",...) so Power BI cannot know that it is a date. It will then just write them out in the visual without a way to group them together. It is the same as if you make a visual with  "a", "b", "c" as values for the x-axis.  

 

But it would be easier to diagnose when we could see your data model. You can blur the sensitive parts.

Please check that your date column is of data type "date" and not "text". 

Thank you for responding. My data table is very simple. Even if I add the date (from date table) instead of the day, I cannot adapt the x-axis. The days on the axis are more reader-friendly than the dates, but I can work with the dates if it allows me to compress the x-axis. My data model is as shown below, where DateInvoiced is linked to my date table.

Cadenze_1-1719136221462.png

 

Please let me know if you need any further details.

Hello again. I actually solved it by replacing day with date and then add a minimum and maximum to the range, which is an option I did not have before. Thank you again.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors