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! Learn more
Hi All, I've solved this issue in Power Query, but would prefer a DAX solution. I've tried a EARLIER function, but can't quite get the results I need. Anyhow I have a table that looks like the following. What I would like to do is to calculate the time difference between each page access.
| user | page url | date/time accessed | 
| joe | page 1 | 12/11/2019 10:00:01 | 
| fred | page 1 | 12/11/2019 10:00:01 | 
| joe | page 3 | 12/11/2019 10:00:04 | 
| joe | page 4 | 12/11/2019 10:00:05 | 
| fred | page 5 | 12/11/2019 10:00:07 | 
| fred | page 6 | 12/11/2019 10:00:08 | 
| fred | page 7 | 12/11/2019 10:00:21 | 
| joe | page 8 | 12/11/2019 10:00:22 | 
| fred | page 9 | 12/11/2019 10:00:22 | 
| joe | page 10 | 12/11/2019 10:00:30 | 
So when in a Table visual I get something along the lines of
| user | page url | date/time accessed | Time on page (s) | 
| joe | page 1 | 12/11/2019 10:00:01 | 3 | 
| joe | page 3 | 12/11/2019 10:00:04 | 1 | 
| joe | page 4 | 12/11/2019 10:00:05 | 1 | 
| joe | page 8 | 12/11/2019 10:00:22 | 17 | 
| joe | page 10 | 12/11/2019 10:00:30 | 
Any help would be greatly appreciated.
Thanks
Alex
Hi @athomp15
Is the below Measure any help?
Measure = 
VAR mdt = MAX(YourTable[date/time accessed])
RETURN 
DATEDIFF(
    mdt,
    CALCULATE(
        MIN(YourTable[date/time accessed]),
        ALLEXCEPT(YourTable, YourTable[user]),
        YourTable[date/time accessed] > mdt
    ),
    SECOND
)
Hope this helps
 
					
				
				
			
		
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
 
            | User | Count | 
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | 
| User | Count | 
|---|---|
| 23 | |
| 12 | |
| 11 | |
| 10 | |
| 9 |