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
Chetanab
Employee
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])


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Chetanab
Employee
Employee

Figured it out. Thanks for helping @Greg_Deckler 

Chetanab_0-1637707200439.png

 

Chetanab
Employee
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
Super User
Super User

@Chetanab Sorry, what defines a segment?


@ 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!:
The Definitive Guide to Power Query (M)

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])


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.