Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I have 2 slicers - one of them displays year while the other displays the month. I want my entire report to be filtered for the last 12 months based on the selected year and month combination. I have a date table with conitnuous dates.
For Example: Year = 2025 and Month = Jul
Then my report needs to be filtered for the dates starting from 01-Aug-2024 until 30-Jul-2025.
Is the only way is to re-create all measures again by changing the filter context so that they are evaulated for the last 12 months. Is there a way to make this work with just the base measures?
Example: If I have measure like this:
Then should I create another measure like below and similarly for every other measures.
BikeSales P12M =
VAR SelectedDate =
MAX ( 'Dimension Period'[Date] )
VAR StartDate1 =
EOMONTH ( SelectedDate, -12 ) + 1
VAR EndDate1 =
IF (
ISFILTERED ( 'Dimension Period' ),
MAX ( 'Dimension Period'[Date] ),
MAXX (
'Dimension Period',
'Dimension Period'[Date]
)
)
RETURN
CALCULATE (
COALESCE ( [SalesAmt], 0 ),
,
FILTER (
ALL ( 'Dimension Period' ),
'Dimension Period'[Date] >= StartDate
&& '01. Dimension Period'[Date] <= EndDate
)
)
Solved! Go to Solution.
To filter your report for the last 12 months based on the Year and Month slicers without rewriting all measures:
- Create a disconnected date slicer table for Year and Month selections.
- Build a single DAX measure that calculates the date range (from 12 months before the selected year/month to the end of the selected month).
- Use this measure as a visual- or page-level filter to restrict data to that range.
- Keep your base measures unchanged, just apply this filter to visuals
To filter your report for the last 12 months based on the Year and Month slicers without rewriting all measures:
- Create a disconnected date slicer table for Year and Month selections.
- Build a single DAX measure that calculates the date range (from 12 months before the selected year/month to the end of the selected month).
- Use this measure as a visual- or page-level filter to restrict data to that range.
- Keep your base measures unchanged, just apply this filter to visuals
Thanks for the suggestion. This works but the dax measure has to be a visual filter and the Date field must be present in the visual. So I have to keep this as a matrix and keep the visual drilled to one level above the date.
You can use the technique described in https://www.sqlbi.com/articles/show-previous-6-months-of-data-from-single-slicer-selection/ .
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 58 | |
| 52 | |
| 40 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 111 | |
| 109 | |
| 40 | |
| 33 | |
| 26 |