Forum Discussion
Vivek26
Advocate I
2 years agoNeed help with a Measure without creating calculated columns
I have a scenario where I need to get the sum of specific rows if they follow a particular path. We need to calculate the sum of rows(column Hours) with DEPT_NAME "HR" only if it also went through ...
Kishore_Kadhir
Resolver II
2 years agoSee if the below measure works:
TotalHourswithHRandOPS =
var concatenation = CONCATENATEX(VALUES(Dept[DeptName]), Dept[DeptName], ",")
var output = SUMMARIZE(Dept, Dept[OrderID], "Dept", SWITCH(TRUE(),
CONTAINSSTRING(concatenation, "OPS") &&
CONTAINSSTRING(concatenation, "HR"), "Yes"))
RETURN
SUMX(FILTER(output, [Dept] <> BLANK()), CALCULATE(SUM(Dept[Hours]), FILTER(Dept, Dept[DeptName] IN {"HR", "OPS"})))
Thanks,
Kishore