Forum Discussion
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
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.
Thank you.
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:
For the related .pbix file,pls click here.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
3 Replies
- amitchandakSuper User
Anonymous
Put a visual level filter and remove nonworking days or value =0
- Greg_DecklerCommunity ChampionIs your x-axis categorical or continuous? Try switching it.
- v-kelly-msftCommunity 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:
For the related .pbix file,pls click here.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!