Forum Discussion

MattwBenson's avatar
MattwBenson
New Member
4 years ago
Solved

DateTime Look up in Hybrid Tables

Hi I have some transactions each with a TransactionDateTime column. 

 

For each transaction I want to look up what the Production Date and shift would be 

 

 

My Shift calendar looks as above, basically Day and Night Shift and Night shift spans across midnight, therefore any transactions between midnight and 6 am are for the previous production Day. 

 

I am loading the transactions using Hybrid table with incremental refresh. 

 

I would normally calculate the shift based on a calculated column, but these are not allowed in hybrid model. Another option was to create a column in the transactions with DateandHour to then join to the ShiftCalendar 

Has anyone succesfully managed anything similar? 

 

Thanks

 

Matt 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi MattwBenson ,

     

    Based on this——therefore any transactions between midnight and 6 am are for the previous production Day

    It seems that you want to get the value from previous row in Power Query. 

    If so, please firstly sort by StartTime ascending, and add a Index column, then try to create a custom column:

     

    Below is the output after expanding:

     

    Best Regards,
    Eyelyn Qin
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi MattwBenson ,

     

    Based on this——therefore any transactions between midnight and 6 am are for the previous production Day

    It seems that you want to get the value from previous row in Power Query. 

    If so, please firstly sort by StartTime ascending, and add a Index column, then try to create a custom column:

     

    Below is the output after expanding:

     

    Best Regards,
    Eyelyn Qin
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.