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
jayt93
Frequent Visitor

Dynamic Prior Year Balance with Year Slicer

Hi everyone, 

 

I've been trying to figure out how to do this but couldn't find a good solution yet.

 

I have a matrix visualization showing the following:

YearBalance
2020 & Prior100,000
202150,000
2022150,000
2023200,000

 

I currently have a simple data column set up specifically for 'Year' and it will change to 2021 & Prior once it hits 2024. 

The issue is that this isn't truly dynamic as it obviously doesn't work with date slicers on the dashboard.

For example I have a slicer for 'Number of Years' to show on the dashboard which is set to 3 as default.

Ideally I would like to be able to change the slicer to any number such as 5 and then the matrix will show: 2019 & Prior, 2020, 2021, 2022, and 2023. 

 

The only way I can think of is to create a seperate table with a single row using measures for the Prior Year totals but I was hoping that there would be a more elegant solution.

 

Thank you!

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

Novices can always think of funny ideas ...

Yr to show.pbix

 

ThxAlot_0-1697226627549.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



View solution in original post

2 REPLIES 2
jayt93
Frequent Visitor

You're an absolute genius, worked perfectly.

Thank you for the quick response!

ThxAlot
Super User
Super User

Novices can always think of funny ideas ...

Yr to show.pbix

 

ThxAlot_0-1697226627549.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



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.