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.
Database sample:
I need a DAX Measure (since I'll work with FILTERED VALUES) to calculate the difference between consecutive dates by Squad.
Thank you in advance (=
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pbix file.
Expected result days: =
VAR _current =
MAX ( Data[DateTime] )
VAR _previous =
CALCULATE (
MAX ( Data[DateTime] ),
OFFSET (
-1,
ALL ( Data[Squad], Data[DateTime] ),
ORDERBY ( Data[DateTime], ASC ),
KEEP,
PARTITIONBY ( Data[Squad] )
)
)
RETURN
IF (
HASONEVALUE ( Data[Squad] ),
DATEDIFF ( _previous, _current, MINUTE ) / ( 24 * 60 )
)
Hi,
Please check the below picture and the attached pbix file.
Expected result days: =
VAR _current =
MAX ( Data[DateTime] )
VAR _previous =
CALCULATE (
MAX ( Data[DateTime] ),
OFFSET (
-1,
ALL ( Data[Squad], Data[DateTime] ),
ORDERBY ( Data[DateTime], ASC ),
KEEP,
PARTITIONBY ( Data[Squad] )
)
)
RETURN
IF (
HASONEVALUE ( Data[Squad] ),
DATEDIFF ( _previous, _current, MINUTE ) / ( 24 * 60 )
)
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
6 | |
3 | |
3 | |
3 |
User | Count |
---|---|
13 | |
11 | |
9 | |
8 | |
8 |