Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register 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/ .
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 55 | |
| 48 | |
| 38 | |
| 16 | |
| 15 |
| User | Count |
|---|---|
| 85 | |
| 70 | |
| 38 | |
| 28 | |
| 25 |