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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Chetanab
Microsoft Employee
Microsoft Employee

Total days of the last segment

Hi, I have the below table. I am trying to create a measure for the Total number of days in the final Segment. For example - For ticket 1124, Team 1 was the final owning team and they spent 35.51 days in total to provide a solution but only 1.36 days in the last segment. Please help.

IDTeamTeamTimeStampHandling daysFinal Owning TeamTotal Days by Final Owning TeamFinal Segment (Days)
1124Prep Team(Do not consider) 0Team 10 
1124Team 17/2/2021 7:597.09Team 135.51 
1124Prep Team(Do not consider)7/13/2021 10:090.82Team 10 
1124Team 17/14/2021 5:521.18Team 135.51 
1124Prep Team(Do not consider)7/15/2021 10:0819.05Team 10 
1124Team 18/11/2021 11:2610.95Team 135.51 
1124Prep Team(Do not consider)8/26/2021 10:166.7Team 10 
1124Team 19/6/2021 3:103.28Team 135.51 
1124Prep Team(Do not consider)9/9/2021 9:557.71Team 10 
1124Team 19/21/2021 2:588.56Team 135.51 
1124Prep Team(Do not consider)10/1/2021 16:240.65Team 10 
1124Team 110/4/2021 8:043.09Team 135.51 
1124Prep Team(Do not consider)10/7/2021 10:106.65Team 10 
1124Team 110/18/2021 1:421.36Team 135.511.36
1124Prep Team(Do not consider)10/19/2021 10:247.28Team 10 
1125Prep Team(Do not consider) 0Team 20 
1125Prep Team(Do not consider)5/17/2021 2:010.61Team 20 
1125Team 25/17/2021 16:3811.82Team 222.24 
1125Prep Team(Do not consider)6/2/2021 12:212.29Team 20 
1125Prep Team(Do not consider)6/6/2021 19:232.3Team 20 
1125Team 26/10/2021 2:3110.42Team 222.2410.42
1125Prep Team(Do not consider)6/24/2021 12:3124.12Team 20 
1 ACCEPTED SOLUTION

@Chetanab Oh, that's just Lookup Min/Max:

  VAR __Last = MAXX(FILTER('Table', [Team] = MAX('Table'[Team]),[Timestamp])

RETURN

  MAXX(FILTER('Table',[Team] = MAX('Table'[Team]) && [Timestamp] = __Last),[Handling days])



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Chetanab
Microsoft Employee
Microsoft Employee

Figured it out. Thanks for helping @Greg_Deckler 

Chetanab_0-1637707200439.png

 

Chetanab
Microsoft Employee
Microsoft Employee

@Greg_Deckler Thank you, I modified the solution you provided a bit because I have multiple IDs and different final owning teams against them,
Final leg =
Var __Last = MAXX(FILTER(Sheet1,Sheet1[ID] = EARLIER(Sheet1[ID])&&[Team] = MAX('Sheet1'[Team])),[TeamTimeStamp])
RETURN
MAXX(FILTER(Sheet1,Sheet1[ID] = EARLIER(Sheet1[ID])&&[Team] = MAX('Sheet1'[Team]) && [TeamTimeStamp] = __Last),[Handling days])

Chetanab_0-1637702205197.png

I am getting partial results(screenshot above) I am trying to get the DAX to also return 1.36 in the blank rows of Final leg column. 

 

Greg_Deckler
Community Champion
Community Champion

@Chetanab Sorry, what defines a segment?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_DecklerSegment is the handling days value between 2 time stamps.  Final Segment is the last handling days value (value against max date)of the final owning team for a particular ID. 

@Chetanab Oh, that's just Lookup Min/Max:

  VAR __Last = MAXX(FILTER('Table', [Team] = MAX('Table'[Team]),[Timestamp])

RETURN

  MAXX(FILTER('Table',[Team] = MAX('Table'[Team]) && [Timestamp] = __Last),[Handling days])



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors