Forum Discussion
Viewing months based on current date on charts
Hello,
How can I change the order and view of months on the x-axis on a graph?
I need to display financial YTD sales information. I have used the time intelligence functions to create a new column to display this for me which works as I wish. However, when I come to display this information it starts from January and extends to December (which as this hasn't occured leaves a plateau in the graph).
Either I need to display from april (the start of our financial year) to the current month, or from last year to the current month. E.g as it is august 2019, the x-axis should run from September-18, to August-19. Next month that would then change accordingly.
I am new to Power BI so please as much information as possible would be fab.
Ideally this graph would run from Sep-18 (which you cannot see from this view) to Aug-19
Thanks in advance,
Colleen
Here's how I would do it:
- Make a copy of your date column getting the start of the month: startofmonth = STARTOFMONTH(dates[yourdatecolumnhere])
- Change the format of that column to March 2001 in the Modeling tab.
- Add to your chart and make sure the X axis is listed as categorical.
You should end up with something like this:
- Make a copy of your date column getting the start of the month: startofmonth = STARTOFMONTH(dates[yourdatecolumnhere])
Ah, I see. It's because of your measure formula. Here's what I think are your options:
- You can remove your measure and replace it with the LineTotExcl field instead. That will include the missing months, but will make your chart start at January.
- I think in order to get the graph to start at April, you have to create a custom date/calendar table to create your fiscal year. I'm not familiar with how to do that, but I've read about others having to do this before. I won't be able to help you on that part, unfortunately.
8 Replies
- pbeyeResolver II
Here's how I would do it:
- Make a copy of your date column getting the start of the month: startofmonth = STARTOFMONTH(dates[yourdatecolumnhere])
- Change the format of that column to March 2001 in the Modeling tab.
- Add to your chart and make sure the X axis is listed as categorical.
You should end up with something like this:
- Make a copy of your date column getting the start of the month: startofmonth = STARTOFMONTH(dates[yourdatecolumnhere])