Measure number of parent issue with sub-bugs

Hello folks

I need a measure that show the number of parent issue with and without sub-bugs(issue type at same hierarchy of sub-task)
So i can compares quality evolution of team when i look number of parent issues with and without sub-bugs per month

I try making this:

Measure: Parent Issue With and Without sub-bugs

NonZero(Count(
  Filter(
    Descendants([Issue].CurrentHierarchyMember, [Issue].[Issue]),
    [Measures].[Issues created] > 0
    AND
    [Issue].CurrentMember.Level.Name = "Issue"
    AND
    [Measures].[Sub-bugs created] > 0
  )
))

Measure: Sub-bugs created

[Measures].[Issues created count],
[Issue Type].[Sub-bug])

Result: Chart show number of sub-bugs created per month instead number of parent issues

Hi @Diego_Marcos_Ribeiro,

You are on the right track building the calcauted measures to count Parent Issue With or Without sub-bugs. The principle of iterating through parent issues and checking whether it has a sub-bug is correct.

You might want to modify the calcaution slightly.

  1. chose to iterate through parent issues from the Issue Sub-task hierarchy.
  2. Add the [Time].CurrentHierarchy.DefaultMember to the “Sub-bugs created” as a sub-task might be created later than the parent issue. DefaultMember woudl ignore the creation date for the sub-task.
  3. In the filter part, check whether the parent issue is created in the selected month and has any sub-tasks. This is performance improvement.

Expression to count parent issues with Sub-bugs might look like this:

NonZero(Sum(
  --iterate through individual parent issues
  Filter(
    DescendantsSet([Issue.Sub-task].CurrentMember,[Issue.Sub-task].[Parent]),
    --parent issue is created in period and has any sub-tasks
    DateInPeriod(
      [Measures].[Issue created date],
      [Time].CurrentHierarchyMember) AND
    NOT IsEmpty([Measures].[Issue sub-task keys])
  ),
  --sum up parent issues with sub-bugs
  CASE WHEN --if parent issue has any Sub-bug created at some point
    ([Measures].[Issues created],
    [Issue Type].[Sub-bug],
    [Time].CurrentHierarchy.DefaultMember) > 0
  THEN 1 --count parent issue in as 1
  END
))

Create another calcauted measure to count Parent issues without any Sub-bugs.

NonZero(Sum(
  --iterate through individual parent issues
  Filter(
    DescendantsSet([Issue.Sub-task].CurrentMember,[Issue.Sub-task].[Parent]),
    --parent issue is created in period with or without sub-tasks
    DateInPeriod(
      [Measures].[Issue created date],
      [Time].CurrentHierarchyMember)
  ),
  --sum up parent issues without any sub-bugs
  CASE WHEN
    IsEmpty(
      ([Measures].[Issues created],
      [Issue Type].[Sub-bug],
      [Time].CurrentHierarchy.DefaultMember)
    )
  THEN 1 --count parent issue in as 1
  END
))

More details on calculated measures and mentioned functions are described in the documentation:

Best,
Zane / support@eazyBI.com

Thanks for helping me, Zane

Something went wrong with my chart. 2 issues closed in November are being displayed as items without sub-bugs. But both of them have sub-bugs, but sub-bugs were closed at the end of October. My graph has a blind spot

How do i obtain a measure that shows me the number of items closed that month that have sub-bugs (regardless of whether the sub-bug was closed in the previous month)?

@Diego_Marcos_Ribeiro, both calculations filter issues by their creation date; see the filter criteria:

...
--parent issue is created in period and has any sub-tasks
DateInPeriod(
  [Measures].[Issue created date],
  [Time].CurrentHierarchyMember) AND
...

If you would like to count issues by their resolution date or closing date, then use another issue property, “Issue resolution date” or “Issue closed date” for calculations:

...
--parent issue is resolved in period and has any sub-tasks
DateInPeriod(
  [Measures].[Issue resolution date],
  [Time].CurrentHierarchyMember) AND
...

Nice!
It’s works
Thank you, Zane!

1 Like