Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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 )
)
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!
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 5 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 15 | |
| 12 | |
| 12 |