Calculating average MTTR across the fleet

Hi eazyBi Community,

we are using ticketing system to track performace of out tools. We have “n” Customers and each one has “m” tools. I would like to calculate average MTTR globally and per each Customer and display it in a table.

To track MTTR our tickets type is “Incident” and has fields “Start downtime” and “End dowtime” which are filled in format dd/mm/yyyy hh:mm.

Tentative to caclulate average MTTR is:

AVG([Issue Type].[Incident], DateDiffDays([Measures].[Issue Start downtime],[Measures].[Issue End dowtime]))

with Formatting of type “Decimal”

Seems pretty straight forward, but I don’t see any numbers…I’m using table view with Columns=Measures and Rows=Tool


Hi @nebo ,

Welcome to the eazyBI community.

The Avg function works on a set of entities. The eazyBI app might use various dimensions for calculating the average of its members.
Therefore, you need to specify or filter the set of members for which to calculate the average value. You might see the actual syntax of the Avg here - Avg.

The below MDX expression checks through the Issue dimension to identify the relevant Issues and then calculate the average.

--generate the set of all issue level children for the current member of the Issue dimension
  DescendantsSet([Issue].CurrentHierarchyMember, [Issue].[Issue]),
--the filtering conditions
--condition - relevant issue type
    [Measures].[Issue type] = 'Incident'
--downtime start populated
    NOT IsEmpty([Issue].CurrentHierarchyMember.get('Start downtime'))
--downtime ended in relevant time period
    DateInPeriod([Issue].CurrentHierarchyMember.get('End downtime'),[Time].CurrentHierarchyMember)
--the actual figure for the average if relevant to context
    ([Measures].[Issues created],
    DateDiffDays([Measures].[Issue Start downtime],[Measures].[Issue End downtime])

However, if you have a high number of issues and a multitude of customers*tools, then it is better to define a new JavaScript calculated custom field ‘Downtime duration’ for the relevant issue type and import it as a measure.
You may find out more about JavaScript calculated customfields here - JavaScript calculated custom fields.
In that case, the calculation of the average might be even as simple as this.

CASE WHEN [Measures].[Issues with Downtime duration]>0
[Measures].[Downtime duration]/[Measures].[Issues with Downtime duration]

You might also read about a similar use case in the following community thread - Time between to actions.

Oskars /