How to count the number of worked days based on Time log

Hello, I am looking for a way to count the number of worked days based on Time Log. If the total time log for a person in a day is more significant (i.e. more than 4 hours) then count it a day. I have tried several ways including creating a calculated measure, then try to sum all of them. However, nothing works.
CASE WHEN [Measures].[Hours spent]>4
THEN 1
ELSE 0
END
image

Hello,

Use this formula

Sum(
Filter(
Descendants([Time].[Day].Members, [Time].[Day]),
([Measures].[Hours spent] > 4)
),
1
)

Regards,
Nanda hareesh.

Thanks Nanda but it seems off.
image

Hi @Vu_Tran

The approach provided by @Nanda might work with a slight correction of the syntax, in the Descendants() function:

Sum(
Filter(
Descendants([Time].CurrentMember, [Time].[Day]),
([Measures].[Hours spent] > 4)
),
1
)

In this approach, days with 4 or fewer hours won’t be counted, and if a user has worked 10 days by 4 hours (40 hours in total), the result will be 0 days.

Another approach would be dividing the measure “Hours spent” by 8 to convert hours to office days based on the total logged work:

[Measures].[Hours spent] / 8

In the previous example, it would give 5 days (4*10/8).

Best,
Ilze, support@eazybi.com

thanks @ilze.leite and Nanda, that formula works.