PowerBI customizing X-axis

544 Views Asked by At

I have a Line Graph in PowerBI and the x-axis lists the WeekNumber starting from Week 1 all the way to Week 53. What I am trying to do is customize the X-axis so that instead of starting at Week 1, it puts the current week in the middle of the X-axis.

So for example, if today is Week 2, then Week 2 would be in the middle of the X-axis and the X-axis would start with Week 27 (or whatever is the current week - 26)

1

There are 1 best solutions below

0
On BEST ANSWER

I would recommend:

  1. Using a week number with the year in it, so that the chart doesn't try to sort Week 27 (2016) after Week 2 (2017).
  2. Having a calculated column in your date/calendar table that identifies the relative week (e.g. 0 for current week, -1 for last week, -2 for the week prior, etc).

You can then use your calculated column as a filter to restrict the chart to weeks -26 and above. You would never need to change this filter. Week -26 will change dynamically with each week since it represents 26 weeks ago rather than week 26. The -26 never shows on your chart because your chart would still use the WeekNumber field (with the year as I mentioned above).