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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
soumyaiyer
Helper III
Helper III

Calculate week over week change % in power bi

@johnt75 @speedramps 

 

Need help to Calculate week over week change % in power bi for time by agent below is the example calcuated in excel.

 

Screenshot 2025-08-15 121754.png

12 REPLIES 12
soumyaiyer
Helper III
Helper III

Hi,

 

@SamsonTruong 

 

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.

 

soumyaiyer_0-1755882199822.png

 

 

v-mdharahman
Community Support
Community Support

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. 

 

Screenshot 2025-08-20 074603.png

 I exported the table and the data shows as below.

 

Screenshot 2025-08-20 075731.png

WeekAgent NameAvg Handle TimeAHT_Minutes
1Yusti, Michelle1899-12-30 00:14:190
2Yusti, Michelle1899-12-30 00:07:110
2Yusti, Michelle1899-12-30 00:09:360
2Yusti, Michelle1899-12-30 00:09:420
3Yusti, Michelle1899-12-30 00:07:350
3Yusti, Michelle1899-12-30 00:09:220
3Yusti, Michelle1899-12-30 00:09:260
3Yusti, Michelle1899-12-30 00:10:170
3Yusti, Michelle1899-12-30 00:11:520
4Yusti, Michelle1899-12-30 00:08:170
4Yusti, Michelle1899-12-30 00:08:230
4Yusti, Michelle1899-12-30 00:09:140
4Yusti, Michelle1899-12-30 00:11:450
4Yusti, Michelle1899-12-30 00:12:150
5Yusti, Michelle1899-12-30 00:08:120
5Yusti, Michelle1899-12-30 00:08:180

 

 

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.

soumyaiyer
Helper III
Helper III

The time stored in my excel file is as below.

 

Screenshot 2025-08-18 150139.png

soumyaiyer
Helper III
Helper III

Hi ,

 

Thank you , when I calculate Time Hours conversion is not working.

 

Screenshot 2025-08-18 145206.png

soumyaiyer
Helper III
Helper III

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

soumyaiyer
Helper III
Helper III

Screenshot 2025-08-15 152306.png

Here's is the snapshot of time

soumyaiyer
Helper III
Helper III

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 

shashiPaul1570_
Resolver I
Resolver I

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 

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.

Top Solution Authors