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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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

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

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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