Forum Discussion

snilss91's avatar
snilss91
Frequent Visitor
1 year ago
Solved

Visualize bookings

Hi everyone!

 

I'm trying to visualize the bookings of different rooms and I have sample data below. I have Start Dates with time and End Dates with time and have created the column Booked Dates that goes from start to end with an increment of 1 hour.

 

Any ideas how I can visualize the booked time vs. the unbooked time? General tips would be greatly appreciated as I'm stuck. I would like to be able to show the intensity of the bookings, like for a gym, both with weekday and time of day. I've tried many approaches, for example counting the number of DistinctFridays, which  consistently return one day less than what is booked. Index for Booking = 0 is booked two Fridays, but it returns 1. 

 

DistinctFridays =
SUMX(
    VALUES('TEST'[Index for Booking]),
    VAR CurrentBookingIndex = 'TEST'[Index for Booking]
    VAR DistinctFridayDates =
        SUMX(
            VALUES('TEST'[Dates Booked]),
            VAR TESTAR =
                CALCULATE(
                    COUNTROWS('TEST'),
                    FILTER(
                        ALL('TEST'),
                        'TEST'[Weekday Name] = "Friday" &&
                        'TEST'[Index for Booking] = CurrentBookingIndex &&
                        'TEST'[Dates Booked] = EARLIER('TEST'[Dates Booked])
                    )
                )
            RETURN
                IF(TESTAR > 0, 1, 0)
        )
    RETURN
        DistinctFridayDates
)

 

 

 

Index for OrderIndex for BookingLab Area RoomLab AreaRoomStart DateEnd DateDates BookedWeekday NameSingle DayDuration DaysDuration HoursDuration Days GroupingDuration Days Grouping Index

00PV23.3,P02PV23.3P022023-08-18 09:00:002023-08-25 20:00:002023-08-18 09:00:00FridayFALSE71793 - 7 days3
10PV23.3,P02PV23.3P022023-08-18 09:00:002023-08-25 20:00:002023-08-18 10:00:00FridayFALSE71793 - 7 days3
20PV23.3,P02PV23.3P022023-08-18 09:00:002023-08-25 20:00:002023-08-18 11:00:00FridayFALSE71793 - 7 days3
30PV23.3,P02PV23.3P022023-08-18 09:00:002023-08-25 20:00:002023-08-18 12:00:00FridayFALSE71793 - 7 days3
40PV23.3,P02PV23.3P022023-08-18 09:00:002023-08-25 20:00:002023-08-18 13:00:00FridayFALSE71793 - 7 days3
50PV23.3,P02PV23.3P022023-08-18 09:00:002023-08-25 20:00:002023-08-18 14:00:00FridayFALSE71793 - 7 days3
60PV23.3,P02PV23.3P022023-08-18 09:00:002023-08-25 20:00:002023-08-18 15:00:00FridayFALSE71793 - 7 days3
70PV23.3,P02PV23.3P022023-08-18 09:00:002023-08-25 20:00:002023-08-18 16:00:00FridayFALSE71793 - 7 days3
80PV23.3,P02PV23.3P022023-08-18 09:00:002023-08-25 20:00:002023-08-18 17:00:00FridayFALSE71793 - 7 days3
90PV23.3,P02PV23.3P022023-08-18 09:00:002023-08-25 20:00:002023-08-18 18:00:00FridayFALSE71793 - 7 days3
100PV23.3,P02PV23.3P022023-08-18 09:00:002023-08-25 20:00:002023-08-18 19:00:00FridayFALSE71793 - 7 days3
110PV23.3,P02PV23.3P022023-08-18 09:00:002023-08-25 20:00:002023-08-18 20:00:00FridayFALSE71793 - 7 days3
120PV23.3,P02PV23.3P022023-08-18 09:00:002023-08-25 20:00:002023-08-18 21:00:00FridayFALSE71793 - 7 days3
130PV23.3,P02PV23.3P022023-08-18 09:00:002023-08-25 20:00:002023-08-18 22:00:00FridayFALSE71793 - 7 days3
140PV23.3,P02PV23.3P022023-08-18 09:00:002023-08-25 20:00:002023-08-18 23:00:00FridayFALSE71793 - 7 days3
150PV23.3,P02PV23.3P022023-08-18 09:00:002023-08-25 20:00:002023-08-19 00:00:00SaturdayFALSE71793 - 7 days3
160PV23.3,P02PV23.3P022023-08-18 09:00:002023-08-25 20:00:002023-08-19 01:00:00SaturdayFALSE71793 - 7 days3
170PV23.3,P02PV23.3P022023-08-18 09:00:002023-08-25 20:00:002023-08-19 02:00:00SaturdayFALSE71793 - 7 days3
  • Hi snilss91  -  I recommend using a heatmap-style visualization and some DAX measures to properly count booked vs. unbooked time. i have created dax measure in attachment. please check attached pbix file FYR

     

2 Replies

  • Hi snilss91  -  I recommend using a heatmap-style visualization and some DAX measures to properly count booked vs. unbooked time. i have created dax measure in attachment. please check attached pbix file FYR

     

    • snilss91's avatar
      snilss91
      Frequent Visitor

      Great, thank you! Now I have a bit more to work with.