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

Show data for the last 12 months on a matrix table

Hi All

 

I have a matrix which shows the current selected totals for the segment as well as last year same period value. i.e If I pick January 2023, I am able to see January 2022. However, I am trying to also show to tals for the last 12 months on the same matrix.

 

Please see below table. I have tried using a calendar table with no luck. Please assist.

Lancelot_0-1674737376399.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Lancelot , if you select 1 period and want to display more than one period then use an independent date table in slicer

 

//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = eomonth(_max, -12) +1
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

 

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Lancelot , if you select 1 period and want to display more than one period then use an independent date table in slicer

 

//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = eomonth(_max, -12) +1
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

 

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

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.