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.
Hi @ahmed_MEJRI ,
I have created a fact table like this:
A date table by this measure:
Calendar = CALENDAR("2020/4/30","2020/6/15")
Create a measure like this and use two slicers:
Measure =
VAR _minA =
CALCULATE ( MIN ( 'Calendar'[Date] ), ALLSELECTED ( 'Calendar'[Date] ) )
VAR _maxA =
CALCULATE ( MAX ( 'Calendar'[Date] ), ALLSELECTED ( 'Calendar'[Date] ) )
VAR _minB =
CALCULATE ( MIN ( 'Table'[date] ), ALLSELECTED ( 'Table'[date] ) )
VAR _maxB =
CALCULATE ( MAX ( 'Table'[date] ), ALLSELECTED ( 'Table'[date] ) )
RETURN
CALCULATE (
SUM ( 'Table'[value] ),
'Table'[date] >= _minA
&& 'Table'[date] <= _maxA,
'Table'[date] >= _minB
&& 'Table'[date] <= _maxB
)
Here is my sample file that hopes to help you: Calculate sum(amount) with 2 different periods.pbix
Best Regards,
Yingjie Li
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
thanks for this idea , is it possible to use 2 sum measures (different periods , slicers) and calculate the variance in a single table : it will be fantastic : how can we do that ?
@ahmed_MEJRI , can explain with an example. I thought this what needed
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601
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.