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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Learnpbi
Regular Visitor

Calculate the difference in created date and resolved date

hi Team

 

I have two columns in the sample set provided below, both are these date columns with date and time stamp.

 

What do I want to calculate

 

1) Calculate the average time it took John or Tim to resolve all queries (please note assignee column is not complete in real data set there will always be value in this column).

 

2) In real data set resolved column can be blank, and when it is blank then it average value calculated above should not include this in the calculation.

 

 

Power Bi query.png

 

 

Regards

 

Power Bi Learner

 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Learnpbi

Create calculated columns

difference = DATEDIFF([Created],[Resloved],MINUTE)

average = AVERAGEX(FILTER(ALL(Sheet5),AND(OR([Assignee]="John",[Assignee]="Tim"),[Resloved]<>BLANK())),[difference])

Or 

average2 = CALCULATE(AVERAGE(Sheet5[difference]),FILTER(ALL(Sheet5),[Assignee]="John"||[Assignee]="Tim"&&[Resloved]<>BLANK()))

5.png

 

Best Regards

maggie

View solution in original post

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @Learnpbi

Create calculated columns

difference = DATEDIFF([Created],[Resloved],MINUTE)

average = AVERAGEX(FILTER(ALL(Sheet5),AND(OR([Assignee]="John",[Assignee]="Tim"),[Resloved]<>BLANK())),[difference])

Or 

average2 = CALCULATE(AVERAGE(Sheet5[difference]),FILTER(ALL(Sheet5),[Assignee]="John"||[Assignee]="Tim"&&[Resloved]<>BLANK()))

5.png

 

Best Regards

maggie

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors