cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Averages Times

GM!

 

So, I need to get the average response time of bookings by warehouse and by equipment.

 

 

 

 

.......

 

The dates are from different tables.

How can i do this? I know i'll need some formulas, but i cant reach them atm.

If you need more info tell me!

 

TY everyone 😄

7 REPLIES 7
Highlighted
Super User IX
Super User IX

Re: Averages Times

@170323003 , you need to have a common row context for that. refer to my blog. Same is true for import mode

https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Differ...



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Helper I
Helper I

Re: Averages Times

Hi, ty for your response.

Although i didnt get 😞

Could you be more specific or explain me by an easier way?

Highlighted
Solution Sage
Solution Sage
Highlighted
Super User V
Super User V

Re: Averages Times

Hi @170323003 ,

 

You need to share more information.

 

Sharing 2 columns with Date and Time will not help.

 

Try using DATEDIFF and then Average.

 

Regards,

Harsh Nathani

 

Highlighted
Helper I
Helper I

Re: Averages Times

Ok, lets go:

 

 

 

 I want to know, in average, how many time do bookings take to be allocated.

 

The relations are

Bookings ---> Equipment ---> Reserve

 

I've tried something that is wrong i guess, because there's no direct relation between bookings and reserves:

(measure)

AvgResponseTime = AVERAGEX(Bookings, DATEDIFF(Bookings[Date], Reservas[ResponseDate],HOUR))
 
I'm hardstuck at this one, so if anyone can help me, i would appreciate 😄
Highlighted
Solution Sage
Solution Sage

Re: Averages Times

// For this to work, you have to have:
// Bookings * -> 1 Equipment on [EquipmentID]
// Bookings * -> Reservas on [ReserveID]

AvgResponseTime =
AVERAGEX(
    // This is the table you show
    // in the picture, I assume.
    Bookings, 
    DATEDIFF(
        Bookings[Booking Date],
        RELATED( Reservas[ResponseDate] ),
        HOUR
    )
)
Highlighted
Helper I
Helper I

Re: Averages Times

I got this error:

 

170323003_0-1596726343361.png

 

 

And i didnt get this part u send:

 

170323003_1-1596726399501.png

 

forgot to mention that Reservas[ResponseDate] it's a measure i created: 

ResponseDate = ALL(Reservas[Date])
 
although, if i use simply Reservas[Date] the error is the same

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors