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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Create Array lookup in Query

 

I am trying to measure TAT. To do so, I need to calculate how long an item was in each queue using only the time an item entered each queue.  In excel, I used an array to return the min Entered Queue Date that is greater than the current row's Entered Queue Date where the Name matches. How do I do this in PowerBI Query?

 

Sample Data set:  Name  and Entered Queue exist. I am trying to create the Exit Queue or a Time in Queue column instead.

 

NameEntered QueueExit Queue
321Z279_00JWH2BWP000B3S7/9/2018 10:547/11/2018 13:27
321Z279_00JWH2BWP000B3S7/11/2018 13:277/12/2018 14:58
321Z279_00JWH2BWP000B3S7/12/2018 14:587/17/2018 9:23
321Z279_00JWH2BWP000B3S7/17/2018 9:237/18/2018 9:00
321Z279_00JWH2BWP000B3S7/18/2018 9:008/15/2018 12:59
321Z279_00JWH2BWP000B3S8/15/2018 12:598/15/2018 13:25
321Z279_00JWH2BWP000B3S8/15/2018 13:258/31/2018 13:30
321Z279_00JWH2BWP000B3S8/31/2018 13:309/13/2018 10:34
321Z279_00JWH2BWP000B3S9/13/2018 10:349/19/2018 13:17
321Z279_00JWH2BWP000B3S9/19/2018 13:17 
321Z15Z_00ECD8YEZ001N3Y4/10/2018 11:324/10/2018 13:17
321Z15Z_00ECD8YEZ001N3Y4/10/2018 13:17 
321Z189_00F5DTK02000F2L1/13/2018 11:331/13/2018 11:36
321Z189_00F5DTK02000F2L1/5/2018 8:231/13/2018 11:31
321Z189_00F5DTK02000F2L1/13/2018 11:36 
321Z189_00F5DTK02000F2L1/13/2018 11:311/13/2018 11:33
321Z189_00F5DTK02000F2L1/3/2018 12:231/5/2018 8:23

 

Thanks.

1 ACCEPTED SOLUTION
LivioLanzo
Solution Sage
Solution Sage

You can use this calculated column:

 

=
CALCULATE (
    MIN ( Table1[Entered Queue] ),
    ALLEXCEPT ( Table1, Table1[Name] ),
    Table1[Entered Queue] > EARLIER ( Table1[Entered Queue] )
)

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

View solution in original post

2 REPLIES 2
LivioLanzo
Solution Sage
Solution Sage

You can use this calculated column:

 

=
CALCULATE (
    MIN ( Table1[Entered Queue] ),
    ALLEXCEPT ( Table1, Table1[Name] ),
    Table1[Entered Queue] > EARLIER ( Table1[Entered Queue] )
)

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Anonymous
Not applicable

LivioLanzo, 

Its so simple and beautiful. It works perfectly. Thank you! 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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