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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Removing X axis values from chart

I have a report where I am tracking production values daily and putting them on a line graph. I have this by calendar day and I want to be able to have a bookmark where the user will be able to switch between calendar day and business day.

 

I have a pretty standard date table in my report and then I have an imported table where we have our company business days all mapped out. I successfully have a graph by calendar and and a graph by business day but when I look at the graph by business day there is a gap between the last business day of the last month and the first business day of the next month. For example it goes from 2/20/2020 to 3/1/2020 so there is an odd diagonal line in my line chart. Is there anyway I can get the visual to go from 2/20/2020 to 3/1/2020 without leaving space for the days between? Also if there is just a completely better way to do what I am trying to do I am open to it. 

 

This is how my dates are set up. The date table was created with

 

DATE = 
VAR MINYEAR = YEAR ( MIN ( Production[Day] ) )
VAR MAXYEAR = YEAR ( MAX ( Production[Day] ) ) 
RETURN
ADDCOLUMNS (
    FILTER (
        CALENDARAUTO( ),
        AND ( YEAR ( [DATE] ) >= MINYEAR, YEAR ( [DATE] ) <= MAXYEAR )
    ),
    "CALENDAR YEAR", "CY " & YEAR ( [DATE] ),
    "MONTH NAME", FORMAT ( [DATE], "MMMM" ),
    "MONTH NUMBER", MONTH ( [DATE] ),
    "WEEKDAY", FORMAT ( [DATE], "DDDD" ),
    "WEEKDAY NUMBER", WEEKDAY( [DATE] ),
    "Quarter", "Q" & TRUNC((MONTH([Date])-1)/3+1
))

 

And is linked to my business days table here. The business days are formatted 2/1/2020 to 2/20/2020 so its MM/"Business Day"/YYYY

 

3-28-2020 6-58-48 PM.png

 

 

This is what my graph looks like by business day and ideally I want to remove the yellow gaps between the days on the X axis. 

 

 

3-28-2020 7-04-52 PM.png

 

 

Thank you.

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi @Anonymous ,

 

Create a calendar table using below dax expression:

 

Table 2 = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))

 

Then create relationships between the 2 tables.

Last in the line chart,use the calendar date as the X -axis,and you will see:

Annotation 2020-03-30 165751.png

 

For the related .pbix file,pls click here.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

 

 

View solution in original post

3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hi @Anonymous ,

 

Create a calendar table using below dax expression:

 

Table 2 = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))

 

Then create relationships between the 2 tables.

Last in the line chart,use the calendar date as the X -axis,and you will see:

Annotation 2020-03-30 165751.png

 

For the related .pbix file,pls click here.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

 

 

Greg_Deckler
Super User
Super User

Is your x-axis categorical or continuous? Try switching it.

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@Anonymous 

Put a visual level filter and remove nonworking days or value =0

Filrer Pane Visual Level filter.png

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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