I want to exclude bugs that their resolution is “not a bug” from linked bugs count as below
Case
When
[Issue].CurrentMember.Level.Name = “Issue”
AND
[Bugs].Currentmember is [Bugs].Defaultmember
and
[Bugs].CurrentHierarchyMember.Get(‘Resolution ID’) != “Not A Bug”
Then
– retrieve Bugs information from Issue property Bugs
Nonzero(Count(
[Issue].CurrentHierarchy.GetLinkedmembers(‘Bugs’)
))
Else
– total calculation for any issue, data on Bugs level
NonZero(Sum(
Descendants([Bugs].Currentmember, [Bugs].[Bugs]),
– counts how many times Bugs are reference with issues, this works as a filter as well
CASE when [Bugs].[Bugs].Members[Resolution] != “Not A Bug” then
[Measures].[Issues created]
END
))
End
Hello @soaad.soliman,
Thanks for posting your question!
Overall you are working in the right direction, just a few adjustments here:
CASE
WHEN
[Issue].CurrentMember.Level.Name = "Issue"
AND
[Bugs].Currentmember IS [Bugs].Defaultmember
AND
[Resolution].[Resolution].GetMemberNameByKey(
[Bugs].CurrentHierarchyMember.Get('Resolution ID')
) <> "Not A Bug"
THEN
Nonzero(Count(
[Issue].CurrentHierarchy.GetLinkedmembers('Bugs')
))
ELSE
NonZero(
Sum(
Filter(
Descendants([Bugs].Currentmember, [Bugs].[Bugs]),
[Resolution].[Resolution].GetMemberNameByKey(
[Bugs].CurrentHierarchyMember.Get('Resolution ID')
) <> "Not A Bug"
),
[Measures].[Issues created]
)
)
END
This is a correct way to show you all the linked bugs that do not have a resolution “not a bug”.
The following line that was in your formula would not work as Resolution ID is not a string, so it cannot compare the name directly.
[Bugs].CurrentHierarchyMember.Get('Resolution ID') != "Not A Bug"
Also, the second Case statement is replaced by Sum & Filter functions to show the total of the Issues (bugs) that are not categorized as “Not a bug”
I hope this helps!
Best,
Marita // support@eazybi.com