Looking to optimize calculated measure

I created a measure to remove Test and Duplicate tickets that appear in my chart. It works but is slow to load, is there a way to optimize? here is the calculated measure:

Sum(
Filter(
DescendantsSet(
[Issue].CurrentHierarchyMember,
[Issue].[Issue]
),
NOT (
[Measures].[Issue summary] MATCHES
‘(?i).(test ticket|duplicate ticket|TEST TEST TEST).
)
),
[Measures].[Issues created]
)

Hi @Timi

Thanks for posting your question!

I recommend importing a new dimension that you could use as a filter to differentiate the Duplicate/Test issues from the Regular ones.

Define an account-specific new calculated custom field (see more details here on how to define a new calculated field at the account level - Account specific calculated fields )

Add the same settings as shown in the screenshot and paste this JS code:

// Identify test/duplicate tickets during data import (runs once)
var summary = issue.fields.summary || "";
var pattern = /test ticket|duplicate ticket|TEST TEST TEST/i;

if (pattern.test(summary)) {
  return "Test or Duplicate";
} else {
  return "Regular";
}

Once you save the configuration, import this field as a Dimension and use as a filter.

Best,

Elita from support@eazybi.com