Calculated Measure to get number of stories and bugs per Epic

Hello, great community!
I’m working on a lot of different projects in our Jira and I’d like to calculate the average ‘size of Epic’.
To do so, I need to create a few calculated measures that will show:

  • Number of stories inside each Epic
  • Number of Bugs inside each Epic (in fact the same as for stories, just another issue type).

I’m not interested in stories and bugs that are related to Epic by ‘link issue’, the main idea is to rely on ‘Epic link’ field (“Issues in this epic”).
I’m almost sure that the solution is simple as for me it sounds like a common measure to track.

Example of how it would be nice to have it in the report (note: I’ve just edited html to visualise the desired result)

And example of the issues that I’d like to calculate

I’ve spent hours on ‘fighting’ with that, but no results. I hope someone here can help
Thank you in advance

@Anton

First, make sure you select to import “Epic link” field from the import options page.
That would create new “EPic link” dimension as well as Issue.Epic hierarchy that you can use in your report.

Then create 2 new calculated measures using these formulas:

Issues in Epic:

Count(Childrenset([Issue.Epic].Currentmember))

Bugs in Epic:

(
[Measures].[Issues created],
[Issue type].[Bug]
)

Martins / eazyBI

Hi @martins.vanags
Incredible solution, thanks for it.
I have a question, Count(Childrenset([Issue.Epic].Currentmember)) always shows me 1 even if there is no issue in the epic.
How can I show 0 if the epic has no incidents?

Hi @feluis23

Try using

Count([Issue.Epic].Currentmember.Children)

Martins / eazyBI

Hello @martins.vanags ,

I used your method to filter the issues in epic and it worked perfectly, amazing.

However, I wanted to create a new column also showing which of the issues in the epic have a completed status. I tried several ways but I always end up encountering an error or filtering the status of the epic.

Could you please help me with this question? How could I proceed?

Thank you in advance

Hi @fillipers

You coudl consider using Generate function to return the comma separate strring of epic children (in Done status)

Generate(
Filter(
DescendantsSet([Issue.Epic].Currentmember,[Issue.Epic].[Parent]),
[Status].[Status].GetMemberNameByKey(
[Issue.Epic].CurrentMember.get('Status ID')
) = "Done"
),
Cast([Issue.Epic].CurrentMember.key as string),
","
)

Martins / eazyBI