# Issues by Transition to status first date - distinct count

**URL:** <https://community.eazybi.com/t/issues-by-transition-to-status-first-date-distinct-count/14590>\
**Category:** Questions & Answers\
**Created:** [December 21, 2023, 10:00am UTC](https://community.eazybi.com/t/issues-by-transition-to-status-first-date-distinct-count/14590 "2023-12-21T10:00:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Sidyakin](https://community.eazybi.com/user_avatar/community.eazybi.com/ivan_sidyakin/32/11312_2.png) [@Ivan\_Sidyakin](https://community.eazybi.com/u/Ivan_Sidyakin)\
**Post date:** [December 21, 2023, 10:00am UTC](https://community.eazybi.com/t/issues-by-transition-to-status-first-date-distinct-count/14590/1 "2023-12-21T10:00:40Z")

</div>

Hello,

I have a report like this:

 ![eazy](https://community.eazybi.com/uploads/default/original/2X/5/5f9f5a9c865b9233cb20c633836e3653dd299e19.png)

It counts the number of issues which had a transition to “Customer Approval” status:

[Measures].[Customer Approval] = ([Measures].[Transitions to status issues count],[Transition Status].[Customer Approval])

The problem is that each issue could have several transitions to ‘Customer Approval’ status during it’s lifecycle. So in my current report configuration if, for example, one same issue had a transition to ‘Customer Approval’ status in October and then again in November, I get one count for each month in the report.

But I want to count issues only one time - in our example for October when the **first transition** happened.

I’ve tried to filter the issues somehow by ‘Transition to status first date’, but it would still count the issue twice if the Time dimension is applied - ‘Transition to status first date’ metric is time scope aware, but I want to count **only the very first transition** to status and output it to the corresponding month in the report (do not count/show any following transitions at all - as if there were none).

Can’t quite get my head around it. Appreciate any help.

Thank you.

---

<div class="post-metadata">

**Author:** ![zane.baranovska](https://community.eazybi.com/user_avatar/community.eazybi.com/zane.baranovska/32/7209_2.png) [@zane.baranovska](https://community.eazybi.com/u/zane.baranovska)\
**Post date:** [December 28, 2023, 2:06pm UTC](https://community.eazybi.com/t/issues-by-transition-to-status-first-date-distinct-count/14590/2 "2023-12-28T14:06:02Z")

</div>

Hi @Ivan_Sidyakin,

The measures “Transitions to status” woudl coun issue in each period when it moved to a specific status (see documentation [Import issue change history](https://docs.eazybi.com/eazybi/data-import/data-from-jira/import-issue-change-history#Importissuechangehistory-Measures)). If you would like to count issues only for the first period when this transition happened, then you should create a **new calcauted measure**.

The calculation would iterate through individual issues. Check whether the **“Transition to status first date”** was in the selected period for each issue.

```auto
NonZero(Count(
  --set of issues
  Filter(
    --iterate through individual issues
    DescendantsSet([Issue].CurrentMember,[Issue].[Issue]),
    --check if first ever status change to Customer Approval was in the selected period
    DateInPeriod(
      ([Measures].[Transition to status first date],
      [Transition Status].[Customer Approval],
      [Time].CurrentHierarchy.DefaultMember),
      [Time].CurrentHierarchyMember)
  )
))

```

Set measure **formatting** to **Integer** ,.  
For more details on calcauted measures and used functions described in the documentation, see the chapter on Set expressions: [Calculated measures](https://docs.eazybi.com/eazybi/analyze-and-visualize/calculated-measures-and-members/calculated-measures).

Check out also Community posts on similar use cases:

> [@Time in status till first transition only](https://community.eazybi.com/t/time-in-status-till-first-transition-only/7397):
>
> Hello, since my management found out how powerful easyBI is, I got asked to create a report for measuring the time between combinations of various statuses. Report should be only for resolved issues and I’m trying to use Average resolution days since cycle start or I was thinkng about creating calculated dimension using Transition from status fist date but I don’t know how to put it together frowning 1st report should answer the question, what is the average time of all issues which stayed i…

> [@Calculating average time in transition for only the first time this transition is done](https://community.eazybi.com/t/calculating-average-time-in-transition-for-only-the-first-time-this-transition-is-done/2700/1):
>
> Hi, I am trying to build a KPI which shows the time needed to start working on an issue, time between : Open and Ongoing for that I use the calculated measure “Average workdays in transition status” however the issues can go back the status Open, and what I need is to calculate only the average time spent only for the first time this transition is done in a ticket. Is it possible to do that ? Regards, Philippe

Best,  
Zane / [support@eazyBI.com](mailto:support@eazyBI.com)

---

<div class="post-metadata">

**Author:** ![Zuku](https://community.eazybi.com/letter_avatar_proxy/v4/letter/z/7cd45c/32.png) [@Zuku](https://community.eazybi.com/u/Zuku)\
**Post date:** [July 12, 2024, 10:33am UTC](https://community.eazybi.com/t/issues-by-transition-to-status-first-date-distinct-count/14590/3 "2024-07-12T10:33:51Z")

</div>

I have the same use case and wanted to use code example that you’ve provided, but I get an error:

> Formula is not valid:  
> Syntax error at line 10, column 7, token ‘[Time]’

Is there a mistake in code there?

Regards,  
Bartek

---

<div class="post-metadata">

**Author:** ![zane.baranovska](https://community.eazybi.com/user_avatar/community.eazybi.com/zane.baranovska/32/7209_2.png) [@zane.baranovska](https://community.eazybi.com/u/zane.baranovska)\
**Post date:** [July 16, 2024, 7:35am UTC](https://community.eazybi.com/t/issues-by-transition-to-status-first-date-distinct-count/14590/4 "2024-07-16T07:35:06Z")

</div>

Thank you, @Zuku, for noticing. One comma was missing in the tuple expression.  
I updated the formula in the post.
