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
shakkedgo
Frequent Visitor

Sum of totals, date diff

hey all,

I have recods with ID ,line and Area 

each ID has multiple lines and each of those has start date and end date (see table)

 

IDLINEAreastart dateend date
1111A1/1/22 13:40:011/1/22 13:40:03
1112A 1/1/22 13:40:011/1/22 13:50:03
1113A1/1/22 13:38:011/1/22 20:38:01
2221A2/2/22 10:40:102/2/22 10:50:02
2222A2/2/22 10:40:062/2/22 11:40:10
3331B1/1/22 13:40:011/1/22 16:40:01

 

I wnat to create a table to see the max time between each ID and then sum the the max by Area

the result sould look like this

the max beetween orders:

IDAreatime
111A7
222A1
333B3

 

and then:

 

Areatotal Hours
A8
B3

 

thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@shakkedgo , Try like

 

Sumx(summarize(Table, Table[ID], Table[Area]), calculate(Maxx(Table, datediff(Table[start Date], Table[End Date], hour) )))

View solution in original post

2 REPLIES 2
shakkedgo
Frequent Visitor

thanks 
it works 

amitchandak
Super User
Super User

@shakkedgo , Try like

 

Sumx(summarize(Table, Table[ID], Table[Area]), calculate(Maxx(Table, datediff(Table[start Date], Table[End Date], hour) )))

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.