Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Custom Timing in the Heatmap

Hi PBIXER,

I want to make a Heatmap where Timing of the Working hours is from the 10 am to 3 am in a 24 hours cycle.

and then the 3 am to 10 am in Close Store for the club .

Cracking my head as technically after 12 am the day changes and the Sales Value and Order Details would fetch or read in the Day cycle.

 

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    If each day's orders are during business hours, you can create this calculated column in the fact table to determine which day the order belongs to.

     

    Date = 
    SWITCH(
        TRUE(),
        TIMEVALUE('FactSales'[Date_Time])>=TIME(10,0,0),DATEVALUE('FactSales'[Date_Time]),
        TIMEVALUE('FactSales'[Date_Time])<=TIME(3,0,0),DATEVALUE('FactSales'[Date_Time])-1
    )

     

    Creating relationships with calendar tables.

    Then you can calculate the daily sales.

    Attached PBIX file for reference.

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data

3 Replies

  • Anonymous , If you have datetime field create a shift

     

    If( timevalue([DateTime]) >= time(10,0,0) && timevalue([DateTime]) < time(15,0,0) , "Shift1" , "Shift2")

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Amit,

      Thank You for the Swift replay Amit,

      Can you please show a sample example or maybe a similar PBIX file regarding this unable to grasp it.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    If each day's orders are during business hours, you can create this calculated column in the fact table to determine which day the order belongs to.

     

    Date = 
    SWITCH(
        TRUE(),
        TIMEVALUE('FactSales'[Date_Time])>=TIME(10,0,0),DATEVALUE('FactSales'[Date_Time]),
        TIMEVALUE('FactSales'[Date_Time])<=TIME(3,0,0),DATEVALUE('FactSales'[Date_Time])-1
    )

     

    Creating relationships with calendar tables.

    Then you can calculate the daily sales.

    Attached PBIX file for reference.

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data