# Getting the count of specific value in given field

**URL:** <https://community.eazybi.com/t/getting-the-count-of-specific-value-in-given-field/4088>\
**Category:** Questions & Answers\
**Tags:** calculatedmembers, mdx\
**Created:** [April 3, 2020, 12:55pm UTC](https://community.eazybi.com/t/getting-the-count-of-specific-value-in-given-field/4088 "2020-04-03T12:55:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vrukesh](https://community.eazybi.com/user_avatar/community.eazybi.com/vrukesh/32/2753_2.png) [@vrukesh](https://community.eazybi.com/u/vrukesh)\
**Post date:** [April 3, 2020, 12:55pm UTC](https://community.eazybi.com/t/getting-the-count-of-specific-value-in-given-field/4088/1 "2020-04-03T12:55:57Z")

</div>

Hi,

Am a newbie trying to learn EazyBi features.

On closing an issue, we add the reason for closure. Field “Closed Reason” can be “Software”, “Hardware” etc. We want to count number of specific value of “Closed Reason” over time interval.

In “Pages’”, we have added “Closed Reason”, and highlighted Select members -\> “All Closed Reason”. In “Rows”, we have added “Time” and highlighted “All hierarchy level members” -\> Month.

This formula does not count correctly the number of the bugs closed due to “Software” for each month.

Aggregate(  
Filter(  
[Closed Reason].Members,  
[Closed Reason].CurrentHierarchyMember.Name MATCHES ‘Software Change’  
)  
)

Any suggestions to correct this.

Thanks,  
Vrukesh

---

<div class="post-metadata">

**Author:** ![vrukesh](https://community.eazybi.com/user_avatar/community.eazybi.com/vrukesh/32/2753_2.png) [@vrukesh](https://community.eazybi.com/u/vrukesh)\
**Post date:** [April 6, 2020, 3:50pm UTC](https://community.eazybi.com/t/getting-the-count-of-specific-value-in-given-field/4088/2 "2020-04-06T15:50:20Z")

</div>

We could resolve this query. Used below formula something like this:

NonZero(  
Count(  
Filter(  
Descendants([Issue].CurrentHierarchyMember,[Issue].[Issue]),  
[Measures].[Issues closed] \> 0 AND  
(  
[Measures].[Issue Closed Reason] = “Software”  
)  
)  
))

---

<div class="post-metadata">

**Author:** ![lauma.cirule](https://community.eazybi.com/user_avatar/community.eazybi.com/lauma.cirule/32/8830_2.png) [@lauma.cirule](https://community.eazybi.com/u/lauma.cirule)\
**Post date:** [April 20, 2020, 9:08am UTC](https://community.eazybi.com/t/getting-the-count-of-specific-value-in-given-field/4088/3 "2020-04-20T09:08:58Z")

</div>

Hi @vrukesh!

I imagine you could solve this without any calculations. Just by adding the **Issues closed measure** on columns and also adding the **Closed reason** expanded to lower level next to Measures on columns and **Time** on rows you would see issues closed for each reason grouped by their closing reason and closing date.

Please let me know if you have further questions regarding this!  
Lauma / [support@eazybi.com](mailto:support@eazybi.com)

---

<div class="post-metadata">

**Author:** ![vrukesh](https://community.eazybi.com/user_avatar/community.eazybi.com/vrukesh/32/2753_2.png) [@vrukesh](https://community.eazybi.com/u/vrukesh)\
**Post date:** [April 20, 2020, 11:47am UTC](https://community.eazybi.com/t/getting-the-count-of-specific-value-in-given-field/4088/4 "2020-04-20T11:47:08Z")

</div>

Hi Lauma,

Yes, the suggested solution works! Thanks for that!

We wanted to further use the value for some calculations. Hope the formula mentioned above is fine too.

Thanks,  
Vrukesh

---

<div class="post-metadata">

**Author:** ![lauma.cirule](https://community.eazybi.com/user_avatar/community.eazybi.com/lauma.cirule/32/8830_2.png) [@lauma.cirule](https://community.eazybi.com/u/lauma.cirule)\
**Post date:** [April 20, 2020, 11:50am UTC](https://community.eazybi.com/t/getting-the-count-of-specific-value-in-given-field/4088/5 "2020-04-20T11:50:46Z")

</div>

@vrukesh,

In such a case, while the formula is correct, it might be resource consuming. It is worth checking if tuple does what you need ([https://docs.eazybi.com/eazybi/analyze-and-visualize/calculated-measures-and-members/calculated-measures#Calculatedmeasures-Tuples](https://docs.eazybi.com/eazybi/analyze-and-visualize/calculated-measures-and-members/calculated-measures#Calculatedmeasures-Tuples)) :

```
(
  [Measures].[Issues closed],
  [Closed Reason].[Software]
)

```

Lauma / [support@eazybi.com](mailto:support@eazybi.com)

---

<div class="post-metadata">

**Author:** ![vrukesh](https://community.eazybi.com/user_avatar/community.eazybi.com/vrukesh/32/2753_2.png) [@vrukesh](https://community.eazybi.com/u/vrukesh)\
**Post date:** [April 20, 2020, 5:01pm UTC](https://community.eazybi.com/t/getting-the-count-of-specific-value-in-given-field/4088/6 "2020-04-20T17:01:17Z")

</div>

Hi Lauma,

yes, this indeed helps to speed up the calculation!!!

Thanks a ton! 🙂  
Vrukesh
