Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Summing Sub Groups for Measure

Hey All,

 

I have a report that contains groups, some of which have subgroups, and I need to calculate everything at the primary group level. The primary metric I'm having an issue with is the Exceeding Goal % which has two inputs, the number of groups exceeding the goal divided by the number of active months. Those measures are currently defined as such:

Active Months = 
var active = FILTER(VALUES(dimGroup[GroupName]),[Active Ind Sum]>0)
return COUNTROWS(active)

Exceeding Goal = 
var Exceed = FILTER(values(dimGroup[Group Name]),[Goal Surplus]>0) 
return COUNTROWS(Exceed)

The use of countrows allows for my needed subgroup logic to take action - if one or more subgroups is active or exceeding goal then that counts as just 1 for both metrics.

 

The issue comes when I try to view the metric outside of a Group context - because it's based off of countrows the inputs do not sum correctly and therefore the metric outside of context (56% below) is off -- should be (7+1) / (5+9) = 64.3%

Any help on this would be greatly appreciated!

3 Replies