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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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])

Share with Power BI Enthusiasts: 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

Share with Power BI Enthusiasts: 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.