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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
RudolphVan
Frequent Visitor

Average Login Times - Earliest Entries

Hi All

 

I need to display the average login time in a card visual, which can be filtered using a User name slicer. Since some users log in and out multiple times per day, we only require the average of the earliest login time recorded each day.

 

Example: We Would only need the average time of te first login time each day.

User - NameUser - IDActionDateTime
User 1001Login2024/04/1607:36:25
User 1001Log Out2024/04/1617:05:33
User 1001Login2024/04/1507:38:48
User 1001Log Out2024/04/1509:22:05
User 1001Login2024/04/1514:06:52
User 1001Log Out2024/04/1517:00:55
User 1001Login2024/04/1408:03:25
User 1001Log Out2024/04/1413:01:36
User 1001Login2024/04/1413:59:52
User 1001Log Out2024/04/1416:49:23

 

I am looking for your support.

Thanks in advance.

1 ACCEPTED SOLUTION
v-jialongy-msft
Community Support
Community Support

@HotChilli , thanks for your concern about this case. 

 

Hi @RudolphVan 

 

You can use the following dax to get the first login time each day:

Column = CALCULATE(MIN('Table'[Time]),FILTER('Table','Table'[Date] = EARLIER('Table'[Date]) && 'Table'[Action] = "Login"))

vjialongymsft_0-1713332647862.png

 

Then you can try converting the time to its corresponding number of seconds, calculating the average of those seconds, and then converting back to the time format.

 

 

 

 

 

Best Regards,

Jayleny

 

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

3 REPLIES 3
v-jialongy-msft
Community Support
Community Support

@HotChilli , thanks for your concern about this case. 

 

Hi @RudolphVan 

 

You can use the following dax to get the first login time each day:

Column = CALCULATE(MIN('Table'[Time]),FILTER('Table','Table'[Date] = EARLIER('Table'[Date]) && 'Table'[Action] = "Login"))

vjialongymsft_0-1713332647862.png

 

Then you can try converting the time to its corresponding number of seconds, calculating the average of those seconds, and then converting back to the time format.

 

 

 

 

 

Best Regards,

Jayleny

 

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

 

Thanks a bunch, this solved my problem.

HotChilli
Super User
Super User

Average of a time? That doesn't sound right.  What would that be for the data shown?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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