Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

Calculate how many times in a month the break was exceeded by an employee

Hi team,

 

I have a data with time in seconds (decimal) which is converted to time format with below DAX.  

Total Aux =
VAR TotalDuration = divide (SUM ( xxxxx[Aux2])+sum(xxxxx[Aux3])+sum(xxxxx[Aux8]),24*60*60)
VAR TotalHours = TRUNC ( 24 * TotalDuration )
VAR MinSec = FORMAT ( TotalDuration - TotalHours / 24, "nn:ss" )
RETURN TotalHours & ":" & MinSec
 
Now I have to count how many days in a month an employee has exceeded (6300 seconds) the break allocated. 
 
I have a date table in my data model as well.
 
Could you please guide me how i can achieve this. 
6 REPLIES 6
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

Please try it,

New measure =
VAR _TotalDuration =
    DIVIDE (
        SUM ( itops_telecom[Aux2] ) + SUM ( itops_telecom[Aux3] )
            + SUM ( itops_telecom[Aux8] ),
        24 * 60 * 60
    )
RETURN
    COUNTX (
        SUMMARIZE (
            FILTER ( ITOps_Telecom, _TotalDuration > 6300 ),
            ITOps_Telecom[logid],
            ITOps_Telecom[row_date]
        ),
        ITOps_Telecom[logid]
    )

If not, can you share a simple example similar? It is difficult to judge the correct measure without scenarios.


Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , You have to try a measure like

 

 

New measure =
var _TotalDuration = divide(SUM ( xxxxx[Aux2])+sum(xxxxx[Aux3])+sum(xxxxx[Aux8]),24*60*60)
return
countx(filter(summarize(table, table[employee], Table[Month Year], "_1", _TotalDuration),[_1]>6300), [Employee])

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak Thanks Amit for replying.

 

I added the below . but its giving blank results. is there something that im doing wrong?

 

New measure =
var _TotalDuration = divide(SUM ( itops_telecom[Aux2])+sum(itops_telecom[Aux3])+sum(itops_telecom[Aux8]),24*60*60)
return
countx(filter(summarize(ITOps_Telecom,ITOps_Telecom[logid], ITOps_Telecom[row_date] , "_1", _TotalDuration),[_1]>6300), ITOps_Telecom[logid])

@Anonymous , row_date will group data at the day level, not the month, if 6300 was the expected value for month

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak  yes. I want to calculate how many days in a month have exceeded 6300 (per day) not 6300 per month

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors