Forum Discussion
Tlotly
Helper V
1 year ago3 months view in a matrix
Good day Is it possible to only show last 3 months on the matrix, based on a Period selection? For example, if I select 202508, I need the matrix to show, Aug 2025, Jul 2025 and Jun 2025. ...
- 1 year ago
You can use the technique described in https://www.sqlbi.com/articles/show-previous-6-months-of-data-from-single-slicer-selection/
- 1 year ago
Tlotly please check this video, https://www.youtube.com/watch?v=anz9iVMU4iI&ab_channel=DeanChereden
Thanks
- 1 year ago
Hi Tlotly
You will need to use a disconnected table for the slicer and reference that in a measure.
Replace the _XMonths value in the measure below.
Total Revenue Last Six Months = VAR _XMonths = 6 VAR _EndDate = -- Get the latest selected date from the disconnected date slicer MAX ( DisconnectedDate[Date] ) VAR _StartDate = -- Calculate the start date by subtracting 6 months from the end date -- and adding 1 day to make it an inclusive range (e.g., from 1st to 30th) EDATE ( _EndDate, -_XMonths ) + 1 RETURN -- Calculate Total Revenue between the calculated start and end dates CALCULATE ( [Total Revenue], -- Use KEEPFILTERS to retain any existing filters on Dates[Date] -- and apply the custom 6-month date range KEEPFILTERS ( Dates[Date] >= _StartDate && Dates[Date] <= _EndDate ) )Please see the attached pbix.
johnt75
Super User
1 year agoYou can use the technique described in https://www.sqlbi.com/articles/show-previous-6-months-of-data-from-single-slicer-selection/