The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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:
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:
How can I remove the gaps but still have the same scale as the chart above it?
Thank you
Hi @mj2024 ,
I reproduced your scene. The problem occurs because the type you use on the x-axis is continuous.
When you change the type to Categorcial, the null value is removed, i.e. non-working days are removed.
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?
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
Is someone able to help me with this?
Hi @mj2024
You should use a categorical x-axis and date column which formatted with a minimal number of chars:
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.
Hi @Ritaf1983
Here is some sample data. Can you please help me with this?
SYMBOL | TRADE_DATE | METRIC1 | METRIC2 | INDEX | |||
ABC | 2024-12-13 | 20177833 | 9024939366 | ABC2024-12-13 | |||
ABC | 2024-12-16 | 23598834 | 10656997446 | ABC2024-12-16 | |||
ABC | 2024-12-17 | 22733494 | 10331463683 | ABC2024-12-17 | |||
ABC | 2024-12-18 | 24444545 | 10691799538 | ABC2024-12-18 | |||
ABC | 2024-12-19 | 22963681 | 10035817507 | ABC2024-12-19 | |||
ABC | 2024-12-20 | 64263694 | 28057528800 | ABC2024-12-20 | |||
ABC | 2024-12-23 | 19152519 | 8336133895 | ABC2024-12-23 | |||
ABC | 2024-12-24 | 7164543 | 3147598676 | ABC2024-12-24 | |||
ABC | 2024-12-26 | 8199927 | 3592470018 | ABC2024-12-26 | |||
ABC | 2024-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 :
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.
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.
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.