TL;DR:
TL;DR
This guide shows how to build a Power BI report that lets users switch between sales totals for the last 30, 60, or 90 days using a single slicer. It covers creating a parameter table, adding it to a slicer, writing a DAX measure with nested IF logic, and displaying the result in a card visual, a simple way to give stakeholders a quick, flexible sales snapshot.
Introduction
In this blog, I’ll explain how to calculate sales for the past 30-60-90 days and display sales data with the help of the Slicers.
Steps to Display Sales Data for the Past 30/60/90 Days
Step1: Create a Parameter Table
Create a table with the help of Enter Data option.
Step2: Add the Table to a Slicer
The table we have created in the above steps will be used in the slicer to filter the data for the 30/60/90/days range.
Want dashboards that give real-time, flexible sales snapshots like this? Our Data Analytics team builds Power BI reports tailored to how your business tracks performance. Explore our Data Analytics services →
Step3: Create the DAX Measure
Create a new measure for calculating the past 30/60/90 Days’ sales.
Logic:-
Last 30/60/90 Days sale =
var days_30=CALCULATE(sum(‘Orders'[Sales]),FILTER(‘Date Table’,’Date Table'[Date]>=TODAY()-29&& ‘Date Table'[Date]<=TODAY()))
var days_60=CALCULATE(sum(‘Orders'[Sales]),FILTER(‘Date Table’,’Date Table'[Date]>=TODAY()-59&& ‘Date Table'[Date]<=TODAY()))
var days_90=CALCULATE(sum(‘Orders'[Sales]),FILTER(‘Date Table’,’Date Table'[Date]>=TODAY()-89&& ‘Date Table'[Date]<=TODAY()))
return
IF(MAX(‘Table'[Last 30/60/90 Days Sale])=”30 Days”,days_30,
IF(MAX(‘Table'[Last 30/60/90 Days Sale])=”60 Days”,days_60,
IF(MAX(‘Table'[Last 30/60/90 Days Sale])=”90 Days”,days_90)))
Step4: Add the Measure to a Card Visual
Drag the measure in the card and select the value in the slicers.
You can see in the screenshot above that shows the sales value for the 30 days. We’ll choose the slicers if you want to show 60 or 90 days.
From simple slicers to complex DAX logic, we help turn raw sales data into dashboards your team actually uses. See how we can help →
Frequently Asked Questions
Common questions about building rolling 30, 60, and 90-day date measures in DAX.
CALCULATE measure with a FILTER that compares your date column to TODAY() minus the number of days you want. For example, filtering for dates greater than or equal to TODAY()-29 gives you a rolling 30-day window that includes today. TODAY()-30, you exclude today itself and only get 29 prior days. Using TODAY()-29 through TODAY() correctly includes today as part of the 30-day range. SWITCH() is generally considered cleaner and easier to read than multiple nested IF() statements, especially as the number of conditions grows. Both work correctly, but SWITCH() is the more maintainable choice if you plan to add more date ranges later. CALCULATE and proper filter context, rather than relying on the visual’s default context, usually fixes this. SUM with COUNT, AVERAGE, or another aggregation function inside the CALCULATE statement for the metric you need. Author By
Kamal Sharma
Kamal brings over 20 years of experience in data analytics and business intelligence. He has led the design and implementation of analytics solutions across operations, financial reporting, and performance improvement initiatives. With a background in business statistics and Six Sigma, his work focuses on applying data in a structured and practical way to solve real business challenges.