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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ChandraDXB
Frequent Visitor

Occup%

Dear All,

 

I am working on calcuating occupancy % for a property portfolio (dummy) consiting of 2 buildings (total 6 units). This % can be at portfolio level or for each builing (using slicers). In terms of time dimesion, occupancy % is for a partcular month or YTD or last 12 months running total and corresponding previous year data. 

 

I have shared here Table 1 which provides information about units occupied, Table 2 which provides information about units available and Table 3 provides information occupancy %. 

 

I will be using slicer for properties and year and month slicer to filter data.

 

Table 1 = Units occupied

 

ChandraDXB_0-1704567171083.png

 

Table 2 Units available

 

ChandraDXB_1-1704567206161.png

 

Table 3  solution - highlighted.

 

ChandraDXB_2-1704567263577.png

 

The source file is https://1drv.ms/x/s!Amn-LF3-8-0ziScRrB84FSiZXdA0

 

I understand we can use DAX to get occupancy % easily rather doing same work in power query.

 

Thanks in advance.

 

 

1 ACCEPTED SOLUTION

see attached for a modified version

View solution in original post

6 REPLIES 6
ChandraDXB
Frequent Visitor

 

 

Dear Ibendlin,

Thanks for your efforts.

The final outcome will be the below:

 

ChandraDXB_0-1704613596539.png

Thanks in advance.

Ok, I figured out the correct formula for both availability and occupancy per unit, independent of date range.  You can take it from here and do your YoY and YTD calculations.

 

 

Available =
VAR d =
    GENERATESERIES ( MIN ( Dates[Date] ), MAX ( Dates[Date] ) ) 
// get units
VAR a =
    SUMMARIZE ( Availability, [Unit No] ) 
// get combined date series for each unit and intersect with date range
VAR b =
    ADDCOLUMNS (
        a,
        "av",
            COUNTROWS (
                INTERSECT (
                    d,
                    VAR u = [Unit No]
                    RETURN
                        SELECTCOLUMNS (
                            GENERATE (
                                SUMMARIZE (
                                    FILTER ( Availability, [Unit No] = u ),
                                    [Available from],
                                    [Available to]
                                ),
                                GENERATESERIES ( [Available from], [Available to] )
                            ),
                            "Value", [Value]
                        )
                )
            )
    ) 
// return percentage
RETURN
    DIVIDE ( SUMX ( b, [av] ), COUNTROWS ( a ) * COUNTROWS ( d ), 0 )

 

same idea for occupancy.

Dear Ibendlin,

 

Oops, we are not getting what we are loooking for.

 

Step 1 - get total no of days available for a unit, aggregate this data at bldg level

Step 2 - get total no of days occupied for a unit, aggregate this data at bldg level

Step 3 - Units occupied/units avaiable - % occupanyc at bldg level

 

this is what DAX has provdied.

ChandraDXB_0-1704694739374.png

This is for 2022 (Jan to Dec)

ChandraDXB_1-1704694838423.png

 

Thansk for your efforts.

 

 

see attached for a modified version

Million thanks for a perfect solution.

lbendlin
Super User
Super User

here's a first stab at it with the general idea.  Still need to figure out the correct formula though .

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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