Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
21 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
27 | |
10 | |
10 | |
9 | |
6 |