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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Calculate AVG Session time

Hi,

I have a table with the date and time for each SessionID
I need to calculate how long is each session? (AVG session time)

Galat198_1-1608058020829.png

 

How is possible without add new columns?

 

TNX

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , You can create a new measure like

 

averageX(summarize(Table, Table[ga_session_id] , "_1", min(Table[event_timestamp]) , "_2", max(Table[event_timestamp])), datediff(_1,_2,second))

 

Now you can filter in Min and max for event name.

 

In place of second you can use minute , hour etc

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , You can create a new measure like

 

averageX(summarize(Table, Table[ga_session_id] , "_1", min(Table[event_timestamp]) , "_2", max(Table[event_timestamp])), datediff(_1,_2,second))

 

Now you can filter in Min and max for event name.

 

In place of second you can use minute , hour etc

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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