Showing results for 
Search instead for 
Did you mean: 
dusdau Frequent Visitor
Frequent Visitor

Dynamically changing months on a vertical bar chart

Hi All,


I'm new to Power BI and I'm trying to achieve something which feels elusive at the moment.  I've googled and searched this forum and have gotten close but I feel my requirement is a little different that what I've seen others do.  Here it is:


The desire is to have a slicer at the top with the following options: Rolling 12, Calendar YTD, Fiscal YTD


Depending on the selection, the MONTHS on the vertical bar chart x-axis of the vertical bar chart would change.


If they select Rolling 12 they want to see sales for the last 12 months, so if its September 2018 they want to see sales for September 2017 thru August 2018, with Month/year on the bar chart, so x-axis would look like this:



Sept 17, Oct 17, Nov 17, Dec 17, Jan 18, Feb 18, Mar 18, Apr 18, May 18, June 18, July 18, Aug 18


If they select Fiscal YTD, the months on the x axis should show the current year fiscal months in order, again for sept 18 (fiscal 2019) it would show:


July, August, September, October, November, December, January, February, March, April, May, June


If they select Calendar YTD, the months on the x axis should simply show the current year months in calendar order:


January, February, March, April, May, June, July, August, September, October, November, December


I have a Date dimension that has different columns for calendar month (sorted on calendar month number) and fiscal month (sorted on fiscal month number), so it seems to me it would just be a matter of toggling the x-axis between those.  That seems doable based on some of the things I've seen online, like this:


However, I'm not sure how I would even approach the Rolling 12 Months one.  I thought maybe I would need to dynamically create the rolling months in my Date dimension, but unsure about that.


Any ideas on how to solve this?  Or resources to point me to?




Community Support Team
Community Support Team

Re: Dynamically changing months on a vertical bar chart


     I think what you want to do is create dynamic measures.

use the below video to do it,

and here is the Blog for you refer:


Best Regards,


Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 412 members 4,201 guests
Please welcome our newest community members: