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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
jd8766
Helper II
Helper II

Get MIN and MAX time per user per day in table?

Hi, I have a table that looks like the below..

I want to show by each day, what the total number of calls was by user, and also the FIRST and LAST time a call was made per user.

jd8766_0-1670499063140.png
My ideal output would be the below..

jd8766_1-1670499164238.png



I have tried the MAX and MIN functions but they return the MAX time in my entire time dimension.. which isn't what I wanted. Any ideas how I can achieve the below?



 

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

Hi @jd8766

 

You can achieve this directly by using MIN and MAX:

 

MINTime = MIN('Table'[Time])
MaxTime = MAX('Table'[Time])

 

 

Then change the Format of the measures:

vjianbolimsft_1-1672820494289.png

Output:

vjianbolimsft_0-1672820407486.png

If your data is more complex, please try:

 

First Time = CALCULATE(MIN('Table'[Time]),FILTER(ALL('Table'),[Date]=MAX('Table'[Date])&&[User]=MAX('Table'[User])))
Last Time = CALCULATE(MAX('Table'[Time]),FILTER(ALL('Table'),[User]=MAX('Table'[User])&&[Date]=MAX('Table'[Date])))

 

 

Output:

vjianbolimsft_2-1672820601792.png

If you need calculated column:

 

FIRSTTIME = CALCULATE(MIN('Table'[Time]),FILTER('Table',[User]=EARLIER('Table'[User])&&[Date]=EARLIER('Table'[Date])))
LASTTIME = CALCULATE(MAX('Table'[Time]),FILTER('Table',[User]=EARLIER('Table'[User])&&[Date]=EARLIER('Table'[Date])))

 

 

Output:

vjianbolimsft_3-1672820970080.png

If you need a table:

 

Table 2 =
SUMMARIZE (
    'Table',
    'Table'[User],
    'Table'[Date],
    "Total Call",
            SUM ( 'Table'[Calls] ),
    "First Time",
            MIN ( 'Table'[Time] ),
    "Last Time",
            MAX ( 'Table'[Time] )
)

 

 

Output:

 vjianbolimsft_0-1672821233686.png

Best Regards,

Jianbo Li

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

2 REPLIES 2
v-jianboli-msft
Community Support
Community Support

Hi @jd8766

 

You can achieve this directly by using MIN and MAX:

 

MINTime = MIN('Table'[Time])
MaxTime = MAX('Table'[Time])

 

 

Then change the Format of the measures:

vjianbolimsft_1-1672820494289.png

Output:

vjianbolimsft_0-1672820407486.png

If your data is more complex, please try:

 

First Time = CALCULATE(MIN('Table'[Time]),FILTER(ALL('Table'),[Date]=MAX('Table'[Date])&&[User]=MAX('Table'[User])))
Last Time = CALCULATE(MAX('Table'[Time]),FILTER(ALL('Table'),[User]=MAX('Table'[User])&&[Date]=MAX('Table'[Date])))

 

 

Output:

vjianbolimsft_2-1672820601792.png

If you need calculated column:

 

FIRSTTIME = CALCULATE(MIN('Table'[Time]),FILTER('Table',[User]=EARLIER('Table'[User])&&[Date]=EARLIER('Table'[Date])))
LASTTIME = CALCULATE(MAX('Table'[Time]),FILTER('Table',[User]=EARLIER('Table'[User])&&[Date]=EARLIER('Table'[Date])))

 

 

Output:

vjianbolimsft_3-1672820970080.png

If you need a table:

 

Table 2 =
SUMMARIZE (
    'Table',
    'Table'[User],
    'Table'[Date],
    "Total Call",
            SUM ( 'Table'[Calls] ),
    "First Time",
            MIN ( 'Table'[Time] ),
    "Last Time",
            MAX ( 'Table'[Time] )
)

 

 

Output:

 vjianbolimsft_0-1672821233686.png

Best Regards,

Jianbo Li

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

amitchandak
Super User
Super User

@jd8766 , If you create min/max measure thtat will work

 

max(Table[time])

 

min(Table[time]) 

 

 

if you need a column

 

minx(filter(Table, [User] = earlier([User]) ),[Time])

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.

Top Solution Authors