Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Syndicate_Admin
Administrator
Administrator

Dynamic Chart

Hello everyone

I have different types of charts (line, bar, etc.). In all my charts the X-axis are months of the year, and I wanted to know if it is possible that the number of months that the graph shows can be dynamic, that is, that through a visual I can enter the number of months that I want to see and the graphs are filtered and only show the number of months that I have entered

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

Thanks for the reply, do you think you can help me understand it better with a visual aid than you indicate, please

Sure thing! Here is an axample using the RelativeMonthPos field that is in my date table.

Since we are in November, it is represented by 0. If I want to show November and the three months prior, I just set the slicer to -3 to 0. This option (IMO) gives you the most control.

audreygerred_0-1699382861535.png

 

I use the date table from SQLBI that I write about in this blog post (it also has a link where you can get the date table from SQLBI). http://powerbiwithme.com/2023/08/01/the-custom-date-table-edition/

 

You can also use a slicer with date and set the slicer setting to relative date. In this case, I set it to give me the last 4 calendar months, so it shows me the most recently closed 4 months:

audreygerred_1-1699383096901.png

 

 

If I do the last 4 months, it does exactly that - a partial month for this month and a partial month for Jul, because it is getting 4 months worth of data based on the actual date:

audreygerred_2-1699383187472.png

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





audreygerred
Super User
Super User

You can use a relative date slicer and set it to is in the last X number of months where the user decides the number of months. Also, depending on the date table you have, if it has relative columns (like number of months difference relative to the month we are in), you could use that as a slicer/filter as well (i.e. if someone wants to see the current month and the 3 months prior they would select from -3 to 0).





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.