Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Need help to Calculate week over week change % in power bi for time by agent below is the example calcuated in excel.
Hi,
Could you please help with the below:
Need help to Calculate week over week change % in power bi for time by agent below is the example calcuated in excel.
Hi @soumyaiyer,
Thanks for reaching out to the Microsoft fabric community forum.
Your Avg Handle Time is coming into Power BI as Time (time-of-day), but you’re using it as a duration (e.g., 6 min 35 sec). The easiest fix is to convert that column to a numeric duration in Power Query and then do the WoW math.
You can use Power Query which is recommended. In Power Query, select Avg Handle Time -> Transform -> Data Type -> Duration. Then add a numeric helper column by Add Column > Custom Column and use "AHT_Minutes = Duration.TotalMinutes([Avg Handle Time])". Close and apply changes.
Or DAX to create your WoW % measure off that numeric column (example uses minutes)
AHT (Minutes) = SUM('YourTable'[AHT_Minutes])
AHT WoW % =
VAR CurrentWeek = [AHT (Minutes)]
VAR LastWeek =
CALCULATE(
[AHT (Minutes)],
DATEADD('Date'[Date], -7, DAY)
)
RETURN
DIVIDE(CurrentWeek - LastWeek, LastWeek)
If you’d rather stay in DAX and not change Power Query, create a calculated column that turns your time-of-day into minutes:
AHT_Minutes =
HOUR('YourTable'[Avg Handle Time]) * 60
+ MINUTE('YourTable'[Avg Handle Time])
+ SECOND('YourTable'[Avg Handle Time]) / 60
then use the same WoW % measure above. Either route will give you a proper numeric duration so the Week-over-Week % calculation works.
I would also take a moment to thank @shashiPaul1570_, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Best Regards,
Hammad.
Hello,
Thank you for looking into this and helping me.
I tried the DAX route, I created a measure for the AHT_Minutes and tried to create WoW % measure.
The AHT_Minutes does not show values please see below the screenshot. I was unable to create WoW % measure BI is not finding or giving me the option to select the AHT_Minutes which was created. Not sure where I am going wrong.
I exported the table and the data shows as below.
Week | Agent Name | Avg Handle Time | AHT_Minutes |
1 | Yusti, Michelle | 1899-12-30 00:14:19 | 0 |
2 | Yusti, Michelle | 1899-12-30 00:07:11 | 0 |
2 | Yusti, Michelle | 1899-12-30 00:09:36 | 0 |
2 | Yusti, Michelle | 1899-12-30 00:09:42 | 0 |
3 | Yusti, Michelle | 1899-12-30 00:07:35 | 0 |
3 | Yusti, Michelle | 1899-12-30 00:09:22 | 0 |
3 | Yusti, Michelle | 1899-12-30 00:09:26 | 0 |
3 | Yusti, Michelle | 1899-12-30 00:10:17 | 0 |
3 | Yusti, Michelle | 1899-12-30 00:11:52 | 0 |
4 | Yusti, Michelle | 1899-12-30 00:08:17 | 0 |
4 | Yusti, Michelle | 1899-12-30 00:08:23 | 0 |
4 | Yusti, Michelle | 1899-12-30 00:09:14 | 0 |
4 | Yusti, Michelle | 1899-12-30 00:11:45 | 0 |
4 | Yusti, Michelle | 1899-12-30 00:12:15 | 0 |
5 | Yusti, Michelle | 1899-12-30 00:08:12 | 0 |
5 | Yusti, Michelle | 1899-12-30 00:08:18 | 0 |
Hi @soumyaiyer,
Your Avg Handle Time is being read as a DateTime (with 1899-12-30 as the base date). That’s why your AHT_Minutes is always 0. You need to convert it to a Duration or explicitly extract the time portion before calculating minutes. To fix it you can use Power Query. In Power Query, select the Avg Handle Time column. Change the type to Duration (Transform -> Data Type -> Duration). If you don’t see Duration, first change it to Time (this will strip out the 1899-12-30 date), then to Duration. Now add a Custom Column "AHT_Minutes = Duration.TotalMinutes([Avg Handle Time])". Now close & apply.
Now you’ll have a numeric column with minutes that works in your WoW % measure.
If you prefer to fix it in DAX, create a calculated column like this:
AHT_Minutes =
HOUR('YourTable'[Avg Handle Time]) * 60 +
MINUTE('YourTable'[Avg Handle Time]) +
SECOND('YourTable'[Avg Handle Time]) / 60
Make sure the column type of Avg Handle Time in your model is Time, not DateTime. Once you do this, your AHT_Minutes will show correct numbers and then your WoW % measure will work.
Best Regards,
Hammad.
The time stored in my excel file is as below.
Hi ,
Thank you , when I calculate Time Hours conversion is not working.
Please advise whether I need change this to duration
Hi @soumyaiyer
You don’t necessarily have to change your column to a Duration type — it depends on how your data is stored
If your column is already a Duration → you’re fine. Power BI internally stores duration as a decimal number of days (e.g. 01:30:00 = 0.0625). You can safely use it in calculations by converting it into hours, minutes, or seconds as shown earlier.
If your column is Text (e.g. “01:30:00”) → you should convert it to Duration first. You can do this in Power Query by changing the data type to Duration, or in DAX using TIMEVALUE().
If your column is Numeric already (e.g. total seconds or minutes) → no conversion needed, just use that directly in your WoW % formula.
👉 In short: use Duration or Numeric for accurate calculations. If it’s currently Text, convert it.
Hope that clears it up! If this resolves your issue, please give it a kudos 👍 and mark it as the accepted solution so others can benefit too.
Thanks
Shashi Paul
Here's is the snapshot of time
Sorry, I will be unable to share the dataset due to the restrictions from my company. Hence the screenshot.
Hi @soumyaiyer
Oh, I see.
Since you can’t share the data (and I can’t find the screenshot either), here’s a general approach based on your problem statement.
You can calculate Week-over-Week % change for time-based metrics, by first ensuring your time values are in a numeric format (hours, minutes, or seconds).
If your time column is stored as a duration (not text), Power BI already treats it as a decimal day (e.g. 01:30:00= 0.0625). You can convert it into hours like this
Time (Hours) =
HOUR('Table'[Time]) +
MINUTE('Table'[Time]) / 60 +
SECOND('Table'[Time]) / 3600
Then use the Week-over-Week % formula
WoW % Change =
VAR CurrentWeek = SUM('Table'[TimeHours])
VAR LastWeek =
CALCULATE(
SUM('Table'[TimeHours]),
DATEADD('Date'[Date], -7, DAY)
)
RETURN
DIVIDE(CurrentWeek - LastWeek, LastWeek, 0)
Please replace 'Table'[Time] and Table'[TimeHours] with your actual column names.
Rest, if you can share a small sample of your data and expected output, I can tweak the measure for your exact case.
Hope this helps! If it works for you, please give it a kudos 👍 and mark it as the accepted solution so it can help others too.
Thanks
Shashi Paul
Hi @soumyaiyer ,
I think you were going to add the excel data. Please share the dataset you want to apply it on.
Thanks
Shashi Paul