Compare order timestamp to store close time and open time

Hi, @MudassirAli @Harsh Now I have more challenge with the one I created yesterday, we need to add store open time for each row. I can add 9:00AM as store open time for each order in Power Query. Now my question is how I can compare the order submission time with store close and open time. I need to flag those orders if the submitted time falls between one hour before store close and store open time (in this case, every orders that were submitted between 8:00PM a to 9:00AM), Can we do that in PowerBI?

Thanks!

Mikestore_time_query.pbix (45.2 KB)

Hello @Mike,

Thank You for posting your query onto the Forum.

Well is this the type of result that you’re looking for? Below is the screenshot provided for the reference -

I’m also attaching the PBIX file of the working for the reference.

Quick Note: In the data, I’ve observed that none of the orders were placed before 9:00 AM but there are 2 orders placed after 9:00 PM and both of them are highlighted in “RED” color. So if you’ve data where orders were placed before 9:00 AM the formulas in the file will provide you the results accordingly.

Hoping you find this useful and meets your requirements that you’ve been looking for. :slightly_smiling_face:

Thanks and Warm Regards,
Harsh

store_time_query.pbix (48.9 KB)

@Mike
I added another custom column in Power Query so now one shows the orders during Operating Hours (OH) and the other after OH. You can name the column as per your requirement. I don’t think it is possible to do it in one column due to time range intersection. I used the following code to make it work.


Attaching the PBIX and source file.

store_time_query.pbix (66.1 KB) Table.csv (22.5 KB)

Thanks!

Hello @Mike,

Attaching the revised file where you’ll be able to filter out the results based on the circles/flags.

Thanks and Warm Regards,
Harsh

store_time_query.pbix (49.8 KB)

@MudassirAli @Harsh Thank you both for your time and help. I will download the files and try to understand how you guys did. I hope I can easily implement those suggestions you guys gave.

Thanks a lot!

Mike

Hello @Mike,

You’re Welcome. :slightly_smiling_face:

In case, any further assistance required please give a shout. We’ll be more than happy to help. :+1:

Thanks and Warm Regards,
Harah

Hi @Mike, did the response provided by the experts help you solve your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark the thread as solved. Thanks!

@EnterpriseDNA Thanks, yes, that was really helpful. Sorry for the late reply.

Mike

A response on this post has been tagged as “Solution”. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the check box. Thanks!