Forum Discussion

XenDance's avatar
XenDance
Regular Visitor
2 years ago
Solved

Calculating desk usage figures

Good afternoon everyone,   I'm trying to create some visualisations in Power BI for data I've been provided from a desk booking application. The application generates the following example data:  ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi XenDance ,

     

    Okay, I've modified the conditions.

    Maximum Weekdays = 
    VAR __today = TODAY()
    VAR __cur_active_from_date = SELECTEDVALUE('Desks'[Active From])
    VAR __active_from_date = IF(ISBLANK(__cur_active_from_date), MAX('Bookings'[Date]) , __cur_active_from_date)
    VAR __result = IF(ISBLANK(__active_from_date) || __today<__cur_active_from_date, 0, NETWORKDAYS(__active_from_date,__today,1))
    RETURN
    __result
    Weekdays Booked = CALCULATE(COUNTROWS('Bookings'),FILTER('Bookings', NOT WEEKDAY('Bookings'[Date],2) IN {6,7} && 'Bookings'[Date]<=TODAY())) + 0

    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 in the Power BI Forum