# Sum Tempo Billed Hours based on EPIC or ISSUE Name

**URL:** <https://community.eazybi.com/t/sum-tempo-billed-hours-based-on-epic-or-issue-name/9601>\
**Category:** Questions & Answers\
**Created:** [May 19, 2022, 12:50pm UTC](https://community.eazybi.com/t/sum-tempo-billed-hours-based-on-epic-or-issue-name/9601 "2022-05-19T12:50:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fabian\_Lober](https://community.eazybi.com/user_avatar/community.eazybi.com/fabian_lober/32/7137_2.png) [@Fabian\_Lober](https://community.eazybi.com/u/Fabian_Lober)\
**Post date:** [May 19, 2022, 12:50pm UTC](https://community.eazybi.com/t/sum-tempo-billed-hours-based-on-epic-or-issue-name/9601/1 "2022-05-19T12:50:47Z")

</div>

Hey,

I’m trying to calculate values with Tempo Billed Hours by multiple criteria.  
For example, I want to collect all hours which have a specific Epic Link or Issue Name (where the epic link is not available) and then use these to calculate a quote.  
The report should be on a monthly basis for the last 6 or 12 months. Per day is not so important, but it should be listed per _Logged by_.

It’s working sometimes and mostly only for 3 Months. As I understood, it’s because I filter on all Issues which makes it’s damming slow and lead to frequent timeouts.  
I don’t know how to optimize it. It’s my first contact with eazybi 🙂

Can you help me?

 ![Screenshot 2022-05-19 at 14.42.10](https://community.eazybi.com/uploads/default/original/2X/8/8815e5360e04fe6a203ebaf16111baf8f2a8e458.png)

_Example 1 - OOO Hours_

```auto
  CACHE(
    Sum(
      Filter(
          Descendants([Issue].CurrentHierarchyMember,[Issue].[Issue]),
          [Issue].CurrentHierarchyMember.Level.Name = 'Issue'
        ),
        CASE WHEN
            [Issue].CurrentHierarchyMember.Level.Name = 'Issue'
        THEN
            CASE
                WHEN IsEmpty([Measures].[Tempo billed hours])
                  THEN 0.0              
                WHEN CoalesceEmpty([Issue].CurrentMember.Name,'') MATCHES '^OUT.*' 
                  THEN IIf(IsEmpty([Measures].[Tempo billed hours]),0.0,[Measures].[Tempo billed hours])
            END
        END
    )
  )

```

_Example 2 - Billable Hours_

```auto
Cache(
  Sum(
    Filter(
        Descendants([Issue].CurrentHierarchyMember,[Issue].[Issue]),
        [Issue].CurrentHierarchyMember.Level.Name = 'Issue'
      ),
      CASE WHEN
          [Issue].CurrentHierarchyMember.Level.Name = 'Issue'
      THEN
          CASE
              WHEN IsEmpty([Measures].[Tempo billed hours])
                THEN 0.0              
              WHEN CoalesceEmpty([Issue].CurrentMember.Name,'') MATCHES '^OUT.*' 
                THEN 0.0
              WHEN CoalesceEmpty([Issue].CurrentHierarchyMember.get('Epic Link'),'') MATCHES '^INT.*' 
                THEN 0.0
              ELSE
                [Measures].[Tempo billed hours]
          END
      END
  )
)

```

_Example 3 - Non-Billable Hours_

```auto
CACHE(
  IIf(
    [Measures].[Total Hours (Clean)]*[Measures].[Billable Hours]> 0,
    100/[Measures].[Total Hours (Clean)]*[Measures].[Billable Hours],
    0.0
  )
)

```

Thanks & bests  
Fabian

---

<div class="post-metadata">

**Author:** ![daina.tupule](https://community.eazybi.com/user_avatar/community.eazybi.com/daina.tupule/32/8838_2.png) [@daina.tupule](https://community.eazybi.com/u/daina.tupule)\
**Post date:** [May 23, 2022, 12:47pm UTC](https://community.eazybi.com/t/sum-tempo-billed-hours-based-on-epic-or-issue-name/9601/2 "2022-05-23T12:47:48Z")

</div>

It seems you are counting Billed hours for all issues apart from issues with project key OUT and epics with project key INT.

I would suggest counting Billed time and removing billed time from specific project issues and specific epic projects.

The dimension **Project** represents issues. The dimension **Epic Link** has a project level representing Project of Epic.

Please check if this measure could work:

```auto
[Measures].[Tempo billed hours]
-
-- subtract by epic link project
([Measures].[Tempo billed hours],
 [Epic Link].[INT project name])
-
-- subtract by issue project
([Measures].[Tempo billed hours],
[Project].[OUT project name])
+
-- add back issues with both project and epic to avoid double subtraction
([Measures].[Tempo billed hours],
[Epic Link].[INT project namel],
 [Project].[OUT project name])

```

Please use correct names for projects - INT project and OUT project.

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