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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
mj2024
Helper II
Helper II

X-axis scale has gaps in it. How to fix it?

Hi

I have a time series that has data for business days only so there are gaps in the dates (ie no dates/data for holidays).  I don't like how the graph (bar chart with line) is showing the gaps:

Screenshot 2024-12-23 170521.png

I changed the x-axis from continous to categorical and it looks better but now the x-axis scale doesn't line up with the other chart on the same page. I have to scroll to see same time period as the graph above it:

 

Screenshot 2024-12-23 170724.png

 

How can I remove the gaps but still have the same scale as the chart above it?

 

Thank you

 

 

 

 

 

10 REPLIES 10
Anonymous
Not applicable

Hi @mj2024 ,

 

I reproduced your scene. The problem occurs because the type you use on the x-axis is continuous.

vstephenmsft_0-1735800732645.png

 

When you change the type to Categorcial, the null value is removed, i.e. non-working days are removed.

vstephenmsft_1-1735801192279.png

Best Regards,

Stephen Tao

 

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

 

Hi @Anonymous 

The issue is that the scale changes.  The top is continous and bottom is categorical.  Notice how the data fits really nice when I pick continuous but I need to scroll to see the same data when I pick categorical.  Yes, the gaps are gone when I pick categorical but now there is a new problem...I need to scroll to see the same data I could see before.  How do I fix this scroll issue?

Screenshot 2025-01-02 132835.png

Anonymous
Not applicable

Hi @mj2024 ,

 

Unfortunately, this is by design. If you choose the type of continous, this function means it is continuous on the x-axis, and the date of the null value cannot be filtered out by design.

 

 

Best Regards,

Stephen Tao

 

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

one more thing...

the top one shows the scale how I like it "MTH YEAR".  I don't need each day like how categorical shows is.  Not sure if this helps or not but I thought I would share in case it helps with a solution.

Thank you

mj2024
Helper II
Helper II

Is someone able to help me with this?

Ritaf1983
Super User
Super User

Hi @mj2024 
You should use a categorical x-axis and date column which formatted with a minimal number of chars:

 

Ritaf1983_0-1735011492824.png

Workday can be used as a filter if you added the flag column to your date table.

The pbix is attached

If you can’t adapt my solution to your logic, please attach a link to a PBIX file with basic data such as your date, measure, and calendar table.

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi @Ritaf1983 

Here is some sample data.  Can you please help me with this?

 

SYMBOLTRADE_DATE METRIC1 METRIC2 INDEX
ABC2024-12-13 20177833 9024939366 ABC2024-12-13
ABC2024-12-16 23598834 10656997446 ABC2024-12-16
ABC2024-12-17 22733494 10331463683 ABC2024-12-17
ABC2024-12-18 24444545 10691799538 ABC2024-12-18
ABC2024-12-19 22963681 10035817507 ABC2024-12-19
ABC2024-12-20 64263694 28057528800 ABC2024-12-20
ABC2024-12-23 19152519 8336133895 ABC2024-12-23
ABC2024-12-24 7164543 3147598676 ABC2024-12-24
ABC2024-12-26 8199927 3592470018 ABC2024-12-26
ABC2024-12-27 18117713 7800218978 ABC2024-12-27

 

Thank you

Hi @mj2024 
It works as expected ....
Try to check that you have the same modifications as my :

Ritaf1983_0-1735990582501.pngRitaf1983_1-1735990615653.png

The pbix is attached

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi @Ritaf1983 

I tried the categorical approach earlier.  It produces a scroll bar (see earlier post of mine).  Is there a way to create a measure that produces a result that matches (or is close to) the continous version (ie no scroll bar)?

Thank you

Hi @mj2024 

No, the scrolling is generated automatically when there isn’t enough space to display all the labels on the X-axis.
When you select the "Continuous" axis type, the engine groups the points based on hierarchies to reduce their number.
However, when you choose the "Categorical" axis type, the engine understands that you want to display every single point without grouping, so it "does not interfere."
To avoid scrolling/save space, you can create hierarchies yourself with minimal characters, as I demonstrated in your example.

Ritaf1983_0-1736071061415.pngRitaf1983_1-1736071085291.pngRitaf1983_2-1736071111128.png

The updated pbix is attached

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors