Forum Discussion
clewis
4 years agoHelper I
Working with timestamp data - looking at average duration. Please help!
Hi everyone! I have a table of network access data. I have IP addresses and then the date and time of when the device get on and off the network throughout the day. There are multiple associati...
v-luwang-msft
4 years agoCommunity Support
Hi clewis ,
Test below :
Create the data column:
DATE1 = FORMAT('Table'[Log Timestamp],"yyyymmdd")
Then create the below measure:
test = var datediff1=DATEDIFF(
CALCULATE (
MIN ( 'Table'[Visit Start Timestamp] ),
FILTER (
ALL ( 'Table' ),
'Table'[IP ADDRESS] = MAX ( 'Table'[IP ADDRESS] )
&& FORMAT ( 'Table'[Log Timestamp], "yyyymmdd" )
= FORMAT ( MAX ( 'Table'[Log Timestamp] ), "yyyymmdd" )
)),CALCULATE (
MAX ( 'Table'[Visit End Timestamp] ),
FILTER (
ALL ( 'Table' ),
'Table'[IP ADDRESS] = MAX ( 'Table'[IP ADDRESS] )
&& FORMAT ( 'Table'[Log Timestamp], "yyyymmdd" )
= FORMAT ( MAX ( 'Table'[Log Timestamp] ), "yyyymmdd" )
)),
MINUTE)/60 return datediff1Measure = AVERAGEX(FILTER(ALL('Table'),'Table'[DATE1]=MAX('Table'[DATE1])),[test])
Final output:
You could download my pbix file if you need.
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
clewis
4 years agoHelper I