Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
pgiorgi1
Frequent Visitor

Tracking duration between Status

I don't know why I'm having issues like this its I read the forums, watch the youtube videos and its still not hitting home for me. Ugh here is my latest struggle maybe someone can help me out with this.
my goal is to track the time between statuses, I have a spreadsheet that contains;
 
AssetUUID
Datetime
Status
1250
09/05/2021 2:00AM
SOS
1250
09/05/2021 2:45AM
SOS Cancel
15808
09/01/2021 12:45PM
Check in
15808
09/01/2021 5:55PM
Check out
and I need to calculate how long it took takes between Status changes.
I've tried these samples.
 
and I tried to write my dax as follows  
 

 

 

 

status time =
GENERATE('User Data',
   VAR _curUserID = 'User Data'[assetUUID]
   VAR _startperiod = 'User Data'[timeHappenedUTC]
   VAR _curRankedIndex = 'User Data'[RankedIndex]
   VAR _nextRankedIndex = IF(COUNTROWS(FILTER(ALL('User Data'), 'User Data'[RankedIndex] > _curRankedIndex)) > 0, _curRankedIndex + 1, _curRankedIndex)
   VAR _endperiod = CALCULATE(MAX('User Data'[timeHappenedUTC]), FILTER(ALL('User Data'), 'User Data'[RankedIndex] = _nextRankedIndex && 'User Data'[assetUUID] = _curUserID))
   RETURN
   GENERATESERIES(_startperiod, _endperiod, TIME(0,1,0)))

 

 

 

 

and I have tried 

 

 

 

Event =
VAR CurID = 'User Data'[assetUUID]
VAR CurTitle = 'User Data'[Title]
VAR CurDate = 'User Data'[timeHappenedUTC]
VAR MaxDate =
    MAXX (
        FILTER (
            'User Data',
            'User Data'[assetUUID]= CurID
                && 'User Data'[timeHappenedUTC] < CurDate
                && 'User Data'[Title] = "SOS Canceled"
        ),
        'User Data'[timeHappenedUTC]
    )
VAR MinDate =
    IF (
        MaxDate = BLANK (),
        MINX ( FILTER ( 'User Data', 'User Data'[assetUUID] = CurID ), 'User Data'[timeHappenedUTC] ),
        MINX (
            FILTER ( 'User Data', 'User Data'[assetUUID] = CurID && 'User Data'[timeHappenedUTC] > MaxDate ),
            'User Data'[timeHappenedUTC]
        )
    )
RETURN
    IF ( CurBenched = "Not Benched", BLANK (), DATEDIFF ( 

 

 

 

 

but I keep receiving errors that I just can't seem to get myself out of   any advice would be fantastic

1 REPLY 1
Anonymous
Not applicable

I'll be quick and to the point. If you don't get answers for a long time, this most likely means nobody understands what you really want.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.