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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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