This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreGet Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher 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/ .
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 25 | |
| 24 | |
| 22 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 44 | |
| 42 | |
| 42 | |
| 21 | |
| 21 |