вы можете попробовать что-то вроде следующего:
datatable(Category:string, StepName:string, Count_:long, Median_Duration:timespan)
[
"A", "step1", 1200, time(00:00:00),
"A", "step2", 1000, time(00:00:24),
"A", "step3", 800, time(00:00:19),
"B", "step1", 4000, time(00:00:00),
"B", "step2", 3800, time(00:00:37),
]
| summarize StepCount = sum(Count_), Duration = avg(Median_Duration) by Category, StepName
| project Category, p = pack(strcat(StepName, "_Count"), StepCount, strcat(StepName, "_Duration"), Duration)
| summarize b = make_bag(p) by Category
| evaluate bag_unpack(b)
или, если вы в порядке с другой схемой вывода:
datatable(Category:string, StepName:string, Count_:long, Median_Duration:timespan)
[
"A", "step1", 1200, time(00:00:00),
"A", "step2", 1000, time(00:00:24),
"A", "step3", 800, time(00:00:19),
"B", "step1", 4000, time(00:00:00),
"B", "step2", 3800, time(00:00:37),
]
| summarize StepCount = sum(Count_), Duration = avg(Median_Duration) by Category, StepName