Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all,
I wish to create a model with two date slicers (current and previous). Ideally, I want when I select on a date slicer between e.g 1/05/2022 to 31/05/2022 the previous date should dynamically move one month before. In other pages, I would like the previous date to be within the same period selected. For example, if i select 2 months on current date slicer, pevious should be automatically show 2 months before the end date of the current.
I have all the measures such as previous two months sales but all i need is to show the dynamic interactivity between previous and current date slicers. I've tried edit interactions but it seems not to work for my scenario. I'm using two date sliders with between.
Please help
@Anonymous , try one of three options
//previous period month
Same Date range last period =
var _diff = datediff(MIN('Date'[date]),max('Date'[date]),Month)+1
var _p_st_date = MINX('Date',DATEADD('Date'[date],-1*_diff,Month))-1
var _p_end_date = MAXX('Date',DATEADD('Date'[date],-1*_diff,Month))-1
Return
CALCULATE(sum(Sales[Sales Amount]),all('Date'[date]),'Date'[date]>=_p_st_date && 'Date'[date]<= _p_end_date
)
Same Date range last period Month =
var _diff = datediff(MIN('Date'[date]),max('Date'[date]),Month)+1
Return
CALCULATE(sum(Sales[Sales Amount]),dateadd('Date'[date],-1*_diff,Month))
Same Date range last period =
var _diff = datediff(MIN('Date'[date]),max('Date'[date]),Month)+1
var _p_st_date = Eomonth(MINX('Date','Date'[date], _1* _diff)-1
var _p_end_date = Eomonth(MAXX('Date','Date'[date], _1* _diff)
Return
CALCULATE(sum(Sales[Sales Amount]),all('Date'[date]),'Date'[date]>=_p_st_date && 'Date'[date]<= _p_end_date
)
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |