Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Mohs
Helper I
Helper I

Calculate Occupancy (%)

Hi all,


I'm trying to come up with a measure to help measure the occupancy of a particular loading location (A & B). Ships go to these locations and they remain docked for a certain time until loading is complete and the ship leaves. I'd like to have a measure that allows me to view the average occupancy of a day of the week, or week of the month, or month of the year (etc) - per location (A or B). 

Importantly, I don't just want to calculate occupancy on days when the location is busy, but also include occupancy for days when there are no ships loading. Hope that makes sense - really appreciate any feedback. Needless to say I'm pretty new to PBI. 

Here is a sample of the data I'm working with:

Mohs_0-1597187725242.png


Mohs

7 REPLIES 7
Mohs
Helper I
Helper I

Unfortunately I haven't yet resolved this issue. Suggestions would be appreciated!

Provide some sample data in usable form.

Hi @lbendlin , 

See below:

Load dateLoad endDuration (hours)LocationShip
Thu Sep-17 00:00Thu 01:171BSSBBB
Wed Sep-16 18:47Thu 00:596ASS444
Sun Sep-13 16:58Mon 02:3610BSS999
Fri Sep-11 00:01Fri 20:4120ASSQQQ
Thu Sep-10 18:24Thu 23:595ASSQQQ
Wed Sep-09 22:32Thu 14:0816ASS444
Tue Sep-08 16:21Tue 22:046BSS555
Tue Sep-08 05:00Tue 17:0012ASSLLL
Mon Sep-07 10:06Mon 21:4011BSS999
Sun Sep-06 00:00Wed 08:0080ASS111
Sun Sep-06 00:00Sun 00:380ASSMMM
Wed Sep-02 19:44Thu 13:4818ASS444
Tue Sep-01 00:41Tue 19:1619BSS555
Tue Sep-01 00:00Tue 23:5923ASS123
Sun Aug-30 11:13Sun 23:5212BSS999
Sun Aug-30 00:00Sun 23:5923ASS987
Wed Aug-26 19:18Thu 15:3020ASS444
Tue Aug-25 23:28Wed 19:0020ASS111
Tue Aug-25 17:54Tue 23:286BSS555
Mon Aug-24 16:53Tue 00:398BSS555
Mon Aug-24 00:01Mon 16:5316ASS547
Sun Aug-23 16:06Sun 22:156BSS999
Sat Aug-22 08:53Sat 21:4213BSS999
Sat Aug-22 08:53Sun 16:0632ASS222
Sat Aug-22 00:00Sat 00:380BSSBBB
Fri Aug-21 14:15Sat 03:3713ASSMMM
Fri Aug-21 00:01Fri 14:0714ASSQQQ
Thu Aug-20 14:15Thu 23:599ASSQQQ
Wed Aug-19 20:07Thu 14:0718ASS444

 

Thanks,

Mohs

Ashish_Mathur
Super User
Super User

Hi,

Based on that data that you have shared, please let us know the exact result that you are expecting.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,

An example of the results I'm expecting is listed below. Note that some events span over 2 days (and could be more so occupancy needs to be calculated/split based on calendar date.

Below I'm only showing location A for Aug 14 below but the reports needs to be able to do this per location (A and B) and per day (and week/month etc). 

Location A Occupancy
Aug 14: 8%
Aug 15: 43%

Explanation: ship arrives Aug 14 22:09 and leaves Aug 15 at 10:13 (total 12 hours 4 minutes). Occupancy is apportioned to Aug 14 (1h 51m/ 24h) and Aug 15 (10h 14m/24h).

 Thanks in advance!

lbendlin
Super User
Super User

Familiarize yourself with the "CROSSFILTER(,,NONE)"  pattern where you use a Dates/Calendar table against your occupancy table to fill in the gaps in your data. You may want to start small and do that for one location first to see how that works.

 

A sample result will be a list of dates (from your calendar table) with the number of minutes that location (from your occupancy table) had a ship present. 1440 for a full day, 0 for no occupancy.  You'll want to think about how to handle multiple ships per location and day.

Thanks @lbendlin - I'll look into your suggestion !

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.