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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.