Logeshkumar Sivakumar
Menu
Back

Highlight the Past, Not Just the Present -Dynamic 6-Month Views in Power BI

Article. 13 June 2025. 3 min read.

📘 Introduction

Power BI excels at turning data into compelling visuals. In many real-world reporting scenarios, one common business requirement is to view rolling time window, especially when analyzing trends.

A typical use case might be:

"Show data for the last 6 months, ending with the month selected in a slicer."

However, Power BI filters data specific to the selected month.

This blog walks you through exactly how to implement that scenario.

🛠️ Implementation Strategy

To achieve this, we use a Disconnected Slicer and Dynamic DAX Measure:

Slicer_Date =
ADDCOLUMNS(
    SUMMARIZE('[Dim] Date', '[Dim] Date'[Year], '[Dim] Date'[Month Number]),
    "Month Year", FORMAT(DATE([Year], [Month Number], 1), "mmm yyyy"),
    "Date", DATE([Year], [Month Number], 1),
    "Month Year (For Sorting)", FORMAT(DATE([Year], [Month Number], 1), "yyyymm")
)
Flag Last 6 Months =
VAR SelectedMonth = SELECTEDVALUE(Slicer_Date[Date])
VAR StartDate = EDATE(SelectedMonth, -5)
VAR EndDate = EOMONTH(SelectedMonth, 0)
VAR CurrentDate = DATE(VALUES('[Dim] Date'[Year]), VALUES('[Dim] Date'[Month Number]), 1)
RETURN
IF (
    NOT ISBLANK(SelectedMonth) &&
    CurrentDate >= StartDate &&
    CurrentDate <= EndDate,
    1
)

Now, selecting a month (e.g., January 2025) will display data from August 2024 through January 2025.

Play

Dynamic 6-Month Views in Power BI

💼 Real-World Use Case

This functionality is invaluable across various sectors. Rather than filtering data for a single month, this approach provides richer context and better storytelling by showcasing the build-up or trend leading into a chosen point in time.

📈 Business Value

✅ Conclusion

With just a few lines of DAX and a disconnected slicer, you can transform a standard Power BI slicer into a powerful time-intelligence tool.

When one month is selected, you’re not limited to only that month, you can show a rolling range of dates like the last 6 months, making your dashboard truly interactive and valuable for users, and highly reusable across reports.

So, the next time your business wants to dive into past performance leading up to a milestone month, you’ll have just the right technique ready to go.

💬 Have you tried something similar? Or want help implementing it in your own report? Let’s connect!

Leave a comment below to unlock exclusive access to the Power BI (.pbix) file!

#PowerBI #DAX #Analytics+ #Inforiver #RollingMonths #BusinessIntelligence #DataModeling #DynamicSlicer #Tableau #Fabric #DataEngineering #Dataflow #Datapipeline #Datawarehousing #Slicers #Rollingperiod #TimeIntelligence