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
dusdau
Helper II
Helper II

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:  

 

https://www.youtube.com/watch?v=lFd2hjkKz_Q

 

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?

 

Thanks,

Dustin

1 REPLY 1
v-lili6-msft
Community Support
Community Support

hi,@dusdau

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

use the below video to do it, https://www.youtube.com/watch?v=gYbGNeYD4OY

and here is the Blog for you refer:https://community.powerbi.com/t5/Community-Blog/Dynamically-change-the-information-within-a-visual-v...

 

Best Regards,

Lin

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

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.