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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Sri_phani
Helper III
Helper III

Divide HH:MM:SS with time value for Attainment

Hi, 

 

I created duration using the DAX function below but in the same table, I should get the attainment which usually means, how much percentage he is sitting in a call. 

 

In excel we do it as time(0,9,0)/agent sitting time. 

 

I tried using this DAX function: = 'Voice data'[Voice AHT - Time (HH:MM:SS)]/Time(0,9,0)

 

But it isn't working. can anyone help, please. 

 

Voice AHT - Time (HH:MM:SS) =
VAR Duration = DIVIDE(SUM('Voice data'[Sum of Voice Duration]),SUM('Voice data'[Sum of Voice count]),BLANK())
   VAR Hours =
    ROUNDDOWN ( Duration / 3600, 0 )
VAR Minutes =
    ROUNDDOWN ( ( Duration - ( Hours * 3600 ) ) / 60, 0 )
VAR Seconds =
    ROUND(MOD ( Duration - ( Hours * 3600 ), 60 ),0)
VAR H =
    IF ( LEN ( Hours ) = 1,
        CONCATENATE ( "0", Hours ),
        CONCATENATE ( "", Hours )
      )
VAR M =
    IF (
        LEN ( Minutes ) = 1,
        CONCATENATE ( "0", Minutes ),
        CONCATENATE ( "", Minutes )
    )
VAR S =
    IF (
        LEN ( Seconds ) = 1,
        CONCATENATE ( "0", Seconds ),
        CONCATENATE ( "", Seconds )
    )
RETURN IF(H="" && M="" && S="","",
    CONCATENATE (
        H,
        CONCATENATE ( ":", CONCATENATE ( M, CONCATENATE ( ":", CONCATENATE(S,"") ) ) )
    ))
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Sri_phani 

Please try

Attainment =
VAR Duration =
DIVIDE (
SUM ( 'Voice data'[Sum of Voice Duration] ),
SUM ( 'Voice data'[Sum of Voice count] )
)
RETURN
DIVIDE ( 9 * 60, Duration )

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @Sri_phani 

Please try

Attainment =
VAR Duration =
DIVIDE (
SUM ( 'Voice data'[Sum of Voice Duration] ),
SUM ( 'Voice data'[Sum of Voice count] )
)
RETURN
DIVIDE ( 9 * 60, Duration )

Thank you for the solution. It helped me. 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.