I done this
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]let
Source = Excel.CurrentWorkbook(){[Name="Raw_Data"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"DATE", type date}, {"SERNO", type text}, {"INITS", type text}, {"STATE", Int64.Type}, {"MAX_CPHIST_TIME", type time}, {"MIN_CPHIST_TIME", type time}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"DATE", "INITS", "SERNO"}, {{"Max", each List.Max([MAX_CPHIST_TIME]), type time}, {"Min", each List.Min([MIN_CPHIST_TIME]), type time}}),
#"Inserted Time Subtraction" = Table.AddColumn(#"Grouped Rows", "Subtraction", each [Max] - [Min], type duration)
in
#"Inserted Time Subtraction"
but after this
Subtraction results changed to
<strike>
</strike>[/FONT]
And PivotTable show me like that which is wrong result
But your example shows exactly what I want so I am not sure what I am doing wrong