merkle
merkle

Reputation: 1815

How to find the average time per job id in power bi?

I need to find the average time per job id.

Below is the data

enter image description here

I tried this dax query

AverageTime =
AVERAGEX (
    VALUES ( Ratings[Date] ),
    CALCULATE ( AVERAGE ( Ratings[job_id] ) )
)

Data type of Date is Time

Upvotes: 0

Views: 6637

Answers (2)

user8078111
user8078111

Reputation: 468

  1. To calculate the average time per job_id, create a calculated column with the following DAX formula:

     Average Date = 
     var jo_id = 'Table'[job_ID]
    
    Return
    AVERAGEX( 
        FILTER(ALL('Table'), 'Table'[job_ID] = jo_id),
              'Table'[Date])
    
  2. After creating the Average Date column set the data type to Time in the Column tools, and set the format as desired. enter image description here

You should have the desired result.

Output

Another Output

Upvotes: 0

Kin Siang
Kin Siang

Reputation: 2699

I have obtain the result using the following formula, should be correct as you expected. Calculate method is not necessary since the table will filter the value base on id, :

= FORMAT(AVERAGE(Sheet2[date]),"HH:MM:SS")

enter image description here

enter image description here

Upvotes: 1

Related Questions