Average of the custom value of subtasks for parent row

I have a lil issue with a eazyBi report.
I have a report with rows of task with its subtasks.
Now, each subtask has a custom value, now what i would like to do is:
for the row of subtask: custom value is shown
for the row of task: average of custom value of each subtasks is shown.

my solution:
case when issuetype = ‘subtask’
then [measures].[custom value]
case when issuetype = ‘task’
then avg(descendants([issue].currentMember, [issue].[issue]), [measures].[custom value])

the problem here arises is each task has same value.

Another question: is there any way to show average of all the tasks at top of chart?

Any suggestions/comments would be appreciated.

Hi @itlearner0049,

When importing a custom field with a numerical value, eazyBI creates a set of measures, like " created", " resolved", and also an issue property "Issue " (https://docs.eazybi.com/eazybijira/data-import/custom-fields#CustomFields-Totalsofcustomnumberfields).

For the calculation, you might want to use custom field measure " created"; this way, the calculation gets the context of selected values in report dimensions.

To get all the sub-tasks under each Task, you might want to use function ChildrenSet(). This function will also show the custom field value for sub-tasks as subtasks do not have any children.

The updated formula might look like this:

  --set of issues under selected issue or issue itself if no children
  --measure representing custom field value
  [Measures].[<custom field> created]

In the report, set the Issue dimension on rows and select the Sub-task hierarchy to make this work.

Zane / support@eazyBI.com