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!View all the Fabric Data Days sessions on demand. View schedule
Hi,
I have a table with these format:
Date Works
06/12/2024 50
05/12/2024 42
04/12/2024 13
03/12/2024 50
02/12/2024 11
24/11/2024 13
I've created a parameter with numeric range that indicates the days that I need to substract to calculate how may works are before these day.
For instance, if I select in the slice 5 days. It should be:
Today is 07/12, I substract 5 days -> 02/12. So it should sum until 02/12, so the result would be: 11 (02/12)+ 13(24/11) = 24
I'm trying to do with parameter and a measure. In the measure I put:
Any help please?
Solved! Go to Solution.
Hi @mmm286b
Please try this:
Sum2 =
VAR _today =
DATE ( 2024, 12, 7 ) --replace with TODAY()
VAR _daysAgo = _today - [Parameter Value]
RETURN
CALCULATE (
SUM ( 'Table'[Works] ),
KEEPFILTERS ( 'Table'[Date] <= _daysAgo )
)
Hi,
Try this approach
Total = sum(Data[Works])
Measure = calculate([Total],datesbetween(calendar[date],minx(all(calendar),calendar[date]),today()-selectedvalue(Days selector[value])))
Hope this helps.
Hi @mmm286b
Please try this:
Sum2 =
VAR _today =
DATE ( 2024, 12, 7 ) --replace with TODAY()
VAR _daysAgo = _today - [Parameter Value]
RETURN
CALCULATE (
SUM ( 'Table'[Works] ),
KEEPFILTERS ( 'Table'[Date] <= _daysAgo )
)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!