Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Dear Commnity,
I have a measure like this
Number of Requests
20.000
Date from until now (for example 01/01/2021 until 11/21/2022)
And I have a date slicer for the last 2 years and months. For example, if I select the month September from the year 2022 the year 2022 then I want that Date from should be replaced by the selected date.
My meausure should look like this
Number of requests
500
September 2022 until 11/21/2022.
How can I do this?
Thank you very much.
Solved! Go to Solution.
Hi @Learner22 ,
I created some data:
Here are the steps you can follow:
1. Create calculated table.
Table 2 =
CALENDAR(
DATE(2020,1,1),DATE(2022,12,31))
2. Create measure.
Measure =
var _selectyear=SELECTEDVALUE('Table 2'[Date].[Year])
var _selectmonth=SELECTEDVALUE('Table 2'[Date].[Month])
var _monthnumber=MAXX(FILTER(ALL('Table 2'),
FORMAT('Table 2'[Date],"mmmm")=_selectmonth),MONTH('Table 2'[Date]))
return
SUMX(FILTER(ALL('Table'),'Table'[Date]>=DATE(_selectyear,_monthnumber,1)&&'Table'[Date]<=TODAY()),[Value])
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Learner22 ,
I created some data:
Here are the steps you can follow:
1. Create calculated table.
Table 2 =
CALENDAR(
DATE(2020,1,1),DATE(2022,12,31))
2. Create measure.
Measure =
var _selectyear=SELECTEDVALUE('Table 2'[Date].[Year])
var _selectmonth=SELECTEDVALUE('Table 2'[Date].[Month])
var _monthnumber=MAXX(FILTER(ALL('Table 2'),
FORMAT('Table 2'[Date],"mmmm")=_selectmonth),MONTH('Table 2'[Date]))
return
SUMX(FILTER(ALL('Table'),'Table'[Date]>=DATE(_selectyear,_monthnumber,1)&&'Table'[Date]<=TODAY()),[Value])
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
yes, DATESBETWEEN function allows to pinpoint the start and end date of your calculation.
the start date in your case seems MAX(the column you put to slicer) and the end date you can put it TODAY().
Sorry, this doesn't work. If I select a specific month, the measure doesn't reflect that.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.