# Combine Calculate measure and Calculate member in report columns

Hello, eazyBI support team.

I have 3 Calculate members of Issue dimension. For example, one of them:

``````Sum(
Filter(
Descendants([Issue].CurrentHierarchyMember, [Issue].[Issue]),
[Issue].CurrentHierarchyMember.get('Issue type ID') = 10000 AND
)
)
``````

and with them I use 3 measures:

• Issue Created
• Issue Resolved
and the third is a calculate measure that counts issues created and resolved in the same period
``````Sum(
Filter(
-- iterate through set of issues
Descendants([Issue].CurrentMember,[Issue].[Issue]),
-- apply filter criteria to each issue
DateInPeriod(
[Measures].[Issue created date],
[Time].CurrentHierarchyMember) AND
DateInPeriod(
[Measures].[Issue resolution date],
[Time].CurrentHierarchyMember)
),
-- numeric expression - sum of relevant issues
[Measures].[Issues created]
))
``````

When I try to combine them together I donâ€™t have any data in the third measure. I think itâ€™s because of using Filter in both Calculate measure and Calculate member:

Could somebody help me with this? Thanks in advance for your help.

Could somebody help me with my problem?

Creating calculated members in the Issues dimension is tricky, as they may return unexpected or empty values when used together with measures that iterate through issues (as in your case). The calculation formula for the measure â€śIssues created and resolved in periodâ€ť itself seems correct.

Based on your calculated memberâ€™s formula, it seems you have a hidden logical â€śdimensionâ€ť or, in other words, a new aspect of how to group issues based on combinations of two independent fields (issues type and MTU Stream).
In such case, we suggest creating a calculated JavaScript custom field that, during data import, checks values in issue type and MTU Stream fields and, based on their value combination, assigns values Business, Maintenance, or Incidents in this new field for each issue. More about in documentation: JavaScript calculated custom fields
Advanced settings for such a field would be the following:

``````[jira.customfield_issuesgroup]
name = "Group"
data_type = "string"
dimension = true
javascript_code = '''
'''
``````

Then you would select this field to be imported as a dimension. Finally, you would use it in the report columns instead of Issue calculated members.

Best,
Ilze, support@eazybi.com

For Business, Maintenance and Incidents I have different logics. For example, for Maintenance:

``````Sum(
Filter(
Descendants([Issue].CurrentMember, [Issue].[Issue]),
(
[Issue].CurrentMember.get('Issue type ID') = 10000 AND
[Issue].CurrentMember.get('MTU Stream') = "Maintenance"
) OR
(
[Issue].CurrentMember.get('Issue type ID') = 15608 AND
)
)
)
``````

for Incidents:

``````Sum(
Filter(
Descendants([Issue].CurrentHierarchyMember, [Issue].[Issue]),
[Issue].CurrentHierarchyMember.get('Issue type ID') = 13901
)
)
``````

Should it still be a one group with mixed logics?
Could you help me with Javascript code, based on my 3 examples?

@ilze.leite or @eazyBI-Staff Hi, could you help me with my problem?

Here is the sample JavaScript code based on your examples. In the code substitute custom fields:
customfield_MMMMM with your custom fields â€śMTU Streamâ€ť ID in Jira.

``````[jira.customfield_issuesgroup]
name = "Group"
data_type = "string"
dimension = true
javascript_code = '''

//Set Group to Mainenance
if (issue.fields.issuetype.id === "10000" && issue.fields.customfield_MMMMM&& issue.fields.customfield_MMMMM.value === "Maintenance") {
issue.fields.customfield_issuesgroup = "Maintenance"
} else if (issue.fields.issuetype.id === "15608" && issue.fields.customfield_EEEEE) {
issue.fields.customfield_issuesgroup = "Maintenance"
}
// Set Group to Incident
else if (issue.fields.issuetype.id === "13901") {
issue.fields.customfield_issuesgroup = "Incident"
}
// Set Group to Bussiness
else if (issue.fields.issuetype.id === "10000" && issue.fields.customfield_MMMMM && issue.fields.customfield_MMMMM.value === "Business") {