I want to track the number of issues completed on time

count(
Filter(Descendants([Issue].CurrentMember,[Issue].[Issue]),
[Measures].[Issues with due date]>0 and
not isempty([Measures].[Issue due date]) and
DateCompare(DateWithoutTime([Issue].CurrentMember.get(‘Due Date’)),[Issue].CurrentMember.get(‘Actual Gate 4’))>0 AND
([Measures].[Issue status] = “Approve”)
)
))
The above code is meant to track and count the total number of issues that were completed on time, which in this case would be those that “approved date” matches or is less than the “due date”.

currently the code only returns zeros right now. What can I do to fix this?

Hello @irv45,

Thanks for posting your question!

My first guess is that the ‘Due Date’ in your code is written incorrectly. Can you check the use of capital letters? MDX is case-sensitive, and field names have to match exactly what you have in Jira.

Another thing, just FYI, the following lines in your code are duplicates, as the first line is already checking if the due date field is not empty.

[Measures].[Issues with due date]>0 and
not isempty([Measures].[Issue due date])

We have also adjusted the code so it works a bit faster.

In this code, we first filter the issues to include only those with a non-empty ‘Issue due date’, a non-empty ‘Actual Gate 4’ value, and a status of “Approve.” Within this filtered set, we then sum the number of issues where the ‘Due date’ is after the ‘Actual Gate 4’ date. The measure ‘Issues with due date’ is returned for these issues.

Sum(
Filter(
 Descendants(
  [Issue].CurrentMember,[Issue].[Issue]),
NOT IsEmpty([Measures].[Issue due date]) 
AND
NOT IsEmpty([Issue].CurrentMember.Get('Actual Gate 4'))
AND
([Measures].[Issue status] = "Approve")
),
CASE WHEN
 DateCompare( 
  DateWithoutTime([Issue].CurrentMember.get('Due date')),
  [Issue].CurrentMember.get('Actual Gate 4'))>0 AND
THEN
 [Measures].[Issues with due date]
END
)

Let me know if this works!

Best,
Marita / support@eazybi.com

1 Like