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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
anelliaf
Helper II
Helper II

Trailing 12-Month Visual

Hello,

 

I have the following table showing the sum of costs for yyyy-mm:

 

pbi_yyyymm_table.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I'd like to display this in a basic bar chart, but dynamically show the trainling 12-months from the current month.

 

Thanks,

Frank

1 ACCEPTED SOLUTION
jthomson
Solution Sage
Solution Sage

I'm not sure if there's a way to dynamically alter the start/end points of a visual like that, but you could use some logic to get the same result with a filter - if you use the correct combination of dateadd/eomonth/today, you should be able to define each record as being in the previous twelve months or not, then use it as a visual level filter

 

edit - I've completely forgotten that there's relative date filtering as an out of the box option, try dropping your date field into that as a visual level filter and seeing if previous 12 calendar months will get you what you want?

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

Use a relative date filter or same option is also available visual level filter

https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
jthomson
Solution Sage
Solution Sage

I'm not sure if there's a way to dynamically alter the start/end points of a visual like that, but you could use some logic to get the same result with a filter - if you use the correct combination of dateadd/eomonth/today, you should be able to define each record as being in the previous twelve months or not, then use it as a visual level filter

 

edit - I've completely forgotten that there's relative date filtering as an out of the box option, try dropping your date field into that as a visual level filter and seeing if previous 12 calendar months will get you what you want?

I added the date field to the visual filter and used the relative date filter.

 

Thanks for you help!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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