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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
bigfun
Helper I
Helper I

Calculate Total Session Time And Time Per Page

Alright so I am trying to tackle two things within the same table. (linked) 

I was browsing other threads, and most had the start and stop times of a session or a page i...

Total_Session_Time =
var x1=MAXX(Filter(All(ui_PageActionView),[SessionID]=SELECTEDVALUE(ui_PageActionView[SessionID])),[EventTime])
var x2=MINX(Filter(All(ui_PageActionView),[SessionID]=SELECTEDVALUE(ui_PageActionView[SessionID])),[EventTime])

return

x1-x2

 

 

My desired outputs are as follows:


Total Session Time in Seconds/Minbigfun_2-1652985383267.png

 

 


Total Time Per Page in Seconds/Minbigfun_1-1652985327941.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @bigfun ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a measure as below for your first screenshot, please find the details in the attachment.

Total_Session_Time = 
VAR _tab =
    SUMMARIZE (
        'ui_PageActionView',
        'ui_PageActionView'[YYYYMMDD],
        'ui_PageActionView'[SessionID],
        "@duration",
            DATEDIFF (
                MIN ( 'ui_PageActionView'[EventTime] ),
                MAX ( 'ui_PageActionView'[EventTime] ),
                MINUTE
            )
    )
RETURN
    SUMX ( _tab, [@duration] )

yingyinr_2-1653360848456.png

Regarding your second screenshot, I can't find the legend information in your provided excel data, could you please provide more information about the result you expect and the logic involved in the calculation. Thank you.

yingyinr_0-1653360190356.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @bigfun ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a measure as below for your first screenshot, please find the details in the attachment.

Total_Session_Time = 
VAR _tab =
    SUMMARIZE (
        'ui_PageActionView',
        'ui_PageActionView'[YYYYMMDD],
        'ui_PageActionView'[SessionID],
        "@duration",
            DATEDIFF (
                MIN ( 'ui_PageActionView'[EventTime] ),
                MAX ( 'ui_PageActionView'[EventTime] ),
                MINUTE
            )
    )
RETURN
    SUMX ( _tab, [@duration] )

yingyinr_2-1653360848456.png

Regarding your second screenshot, I can't find the legend information in your provided excel data, could you please provide more information about the result you expect and the logic involved in the calculation. Thank you.

yingyinr_0-1653360190356.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.