Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hello,
First of all thank you for your support and assistance,
Please i have this table below:
And i want to calculate the average resolution time in this format "hh:mm:ss" but only for the request number which they have been created between 06h and 19h?
Solved! Go to Solution.
Hi @ayoubb
Create a measure as:
Measure =
var _table=
SUMMARIZE('Table','Table'[Request number],"start",
var _start=
CALCULATE(
MAX('Table'[creation date]),
FILTER(
ALL('Table'),
'Table'[Request number]=MAX('Table'[Request number]) && 'Table'[Status]="resolved" && HOUR('Table'[creation date])>6
)
)
var _end=
CALCULATE(
MAX('Table'[update date]),
FILTER(
'Table',
'Table'[Request number]=MAX('Table'[Request number]) && 'Table'[Status]="resolved" && HOUR('Table'[update date])<19
)
)
return DATEDIFF(_start,_end,SECOND)
)
return SUMX(_table,[start])/COUNTROWS(_table)
Here is the output:
Here is the demo, please try it:DATEDIFF BETWEEN TWO DATE in order to calculate resolution time
Best Regards,
Link
Hi @ayoubb
Create a measure as:
Measure =
var _table=
SUMMARIZE('Table','Table'[Request number],"start",
var _start=
CALCULATE(
MAX('Table'[creation date]),
FILTER(
ALL('Table'),
'Table'[Request number]=MAX('Table'[Request number]) && 'Table'[Status]="resolved" && HOUR('Table'[creation date])>6
)
)
var _end=
CALCULATE(
MAX('Table'[update date]),
FILTER(
'Table',
'Table'[Request number]=MAX('Table'[Request number]) && 'Table'[Status]="resolved" && HOUR('Table'[update date])<19
)
)
return DATEDIFF(_start,_end,SECOND)
)
return SUMX(_table,[start])/COUNTROWS(_table)
Here is the output:
Here is the demo, please try it:DATEDIFF BETWEEN TWO DATE in order to calculate resolution time
Best Regards,
Link
@ayoubb If you can post that data as text could provide a specific solution. But, in the mean time here are a number of articles on duration calculations:
(1) Chelsie Eiden's Duration - Microsoft Power BI Community
Duration to Seconds Converter - Microsoft Power BI Community
By simply subtracting your two time entries like this ([update date] - [creation date]) * 1. , you will get a decimal value where the integer portion is the number of days and your decimal portion is fractions of a day. So 1/24 hours, 1/60 is minutes, 1/3600 seconds, etc.
IS this correct:
Column
&& DATEDIFF('table'[creation date],'table'[update date],MINUTE)
| User | Count |
|---|---|
| 50 | |
| 43 | |
| 36 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 139 | |
| 129 | |
| 61 | |
| 59 | |
| 57 |