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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
anusornkhurana
Regular Visitor

Time Filter Not Working

Hi, 

In another thread , Creating Time Filter, I was looking for a solution to filter First Response Time (Mins) according to create date

 

I wanted to know the average First response time (mins) that were created during working hours 08:00 - 17:00

and average First response time (mins) that were created outside working hours 17:01 - 7:59

 

In my previous thread, @v-tangjie-msft, provided a solution by creating a measure

 

During Working Hours

average(8:00-17:00) = var _a=CALCULATE(SUM('Table'[First Response (Minute)]),FILTER('Table', 'Table'[Create Time]<=TIME(17,00,00) && 'Table'[Create Time]>=TIME(8,00,00)))
var _b=COUNTROWS(FILTER('Table','Table'[Create Time]<=TIME(17,00,00) && 'Table'[Create Time]>=TIME(8,00,00)))

return
DIVIDE(_a,_b,0)

 

Outside Working Hours

average (17:01-7:59) = var _c=CALCULATE(SUM('Table'[First Response (Minute)]),FILTER('Table', 'Table'[Create Time]>=TIME(17,01,00) || 'Table'[Create Time]<=TIME(7,59,00)))
var _d=COUNTROWS(FILTER('Table','Table'[Create Time]>=TIME(17,01,00) || 'Table'[Create Time]<=TIME(7,59,00)))
return 
DIVIDE(_c,_d,0)

 

It was working fine but i changed my data source and suddenly they are returning "blanks" and i can't figure out what went wrong!!

 

I have attached a sample data file 

Column E - Create Time

Column M - First Response Time (Mins)

 

I want to create a measure that finds the average First Response Time (Mins) that occured during working hours (08:00-17:00) and those that occured outside working hours (17:01-7:59)

 

Sample Data Link 

 

Thank you,

 

2 REPLIES 2
amitchandak
Super User
Super User

@anusornkhurana , Avg at what level

 

Example at hour level

 

Sumx( Values('Table'[Hour]),
CALCULATE(SUM('Table'[First Response (Minute)]),FILTER('Table', 'Table'[Create Time]<=TIME(17,00,00) && 'Table'[Create Time]>=TIME(8,00,00)))
)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

At the hour level

average of first response (mins) that occured to all tasks created [Create Time] between 8.00-17.00

 

I tried the measure you gave me it didn't work. It is still returning Blank value 😞

 

Thank you!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.