Calculate an average of an issue property in the project level

Hi @rodrigo.alvareztopa,

When calculating the average, it is essential to specify

  • items and level from which to calculate the average.
  • should it include or exclude zero values.

In some cases, the simple dividing works, like in your case for individual epics, the Compliance % is calculated correctly. But in some cases, it requires specifying the item and level for average calculation.

For example, to calculate the compliance rate at epic level only for epics that have a compliance rate (exclude zero), the expression might look like this:

Avg(
  --set of epics for average calculation
  Filter(
    --iterate through issues at epic level
    DescendantsSet([Issue.Epic].CurrentHierarchyMember,[Issue.Epic].[Epic]),
    --check if epic has any resolved Passed issues to exclude 0 from the average calculation
    ([Measures].[Issues resolved],[Status].[Passed]) > 0
  ),
  --for each epic, calculate the compliance %
  ([Measures].[Issues resolved],[Status].[Passed]) /
  (  
    ([Measures].[Issues resolved],[Status].[Passed]) + 
    ([Measures].[Issues resolved],[Status].[Failed])  
  )
)

More details on aggregate functions are described in the documentation:
https://docs.eazybi.com/eazybi/analyze-and-visualize/calculated-measures-and-members/calculated-measures#Calculatedmeasures-Aggregatemeasures

Best,
Zane / support@eazyBI.com