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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
v-yiruan-msft
Community Support
Community Support

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yiruan-msft
Community Support
Community Support

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors