Filter logged hours

Hi everyone, I need to filter some work logs to find out the number of operational hours and check the annual target, i use this formula:
(
IIF(
[Atendimento].CurrentHierarchyMember IS [Atendimento].[9/5],
[Measures].[Tempo Billed Hours],
0
)
)
+
(
IIF(
[Atendimento].CurrentHierarchyMember <> [Atendimento].[9/5] AND
[Issue Type].CurrentHierarchyMember <> [Issue Type].[Sobreaviso],
[Measures].[Tempo Billed Hours],
0
)
)
i need to get the hours with field “Atendimento” = 9/5 + “Atendimento” != 9/5 and “IssueType” != “Sobreaviso” but this formula returns all the billed hours and not the hours provide by the filter in formula

here’s the report
image

i need some help here

Hi @Viol1914,

It seems that you do not have these dimensions in report context.

In that case, you need to perform calculations with values from issue sets and you can do that by using Tuples.
Please read more about tuples here - Tuple.

So, in this case, you need to add the Tempo Billed hours where the issue is categorized by Atendimento “9/5”.
Then, you add the Tempo Billed Hours for issues that are of all other Atendiento categories, excluding the ones with the issue type “Sobreaviso”.

You might draw a Venn diagram to identify the required dataset.

The Blue ring is all Atendimentos, including 9/5.
The green circle is the Atendimento 9/5. The blue part that is outside the green circle relates to Atendimento <> 9/5.
The red circle is the issue type Sobreaviso.

So, you actually need all the green circle, including overlapping part with the red one, and all the blue circle outside of the red circle.

So, you generally need to remove the part of the red circle that is not overlapping with the green.

You might reformulate the requirement that you want to subtract the “Sobreaviso” Tempo Billed Hours from all Tempo Billed Hours but then re-add the Tempo Billed Hours for “Sobreaviso” where the Atendimento is “9/5”.

The expression for that might be as follows.

[Measures].[Tempo Billed Hours]
-
--subtract all tempo billed hours for undesired issue type
([Measures].[Tempo Billed Hours],
 [Issue Type].[Sobreaviso])
+
--re-add the excess subtracted hours
([Measures].[Tempo Billed Hours],
 [Issue Type].[Sobreaviso],
 [Atendimento].[9/5])

Regards,
Oskars / support@eazyBI.com