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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Randcharles
Helper I
Helper I

DAX _ Calculate occupancy rate

Hi all, 

I have a report where I need to calculate occupancy rate : office reservation/ available desk.

When I need to compute the global occupancy rate for a  month or a week , it shows a wrong rate. 
Example : I have 4 available desks in a month, and 12 people did reservation for a month (number of reservation). 
So when I calculate the rate = DIVIDE( Number of reservation, Available desk), it gives a wrong data as 300%.

Could anyone help how to fix this kind of evaluation context problem in DAX ?
Here is my data model :

Randcharles_0-1722850640359.png

Thanks in advance.

3 REPLIES 3
bhanu_gautam
Super User
Super User

@Randcharles , For this first make sure you have one date table 

 

Then Create a measure for Daily reservation

DailyReservations =
CALCULATE (
    COUNTROWS(Reservations),
    ALLEXCEPT(Reservations, Reservations[ReservationDate])
)
 
Then one more for Desk
DailyOccupancyRate =
DIVIDE (
[DailyReservations],
COUNTROWS(Desks)
)
 
Then create measure for monthly 
MonthlyOccupancyRate =
AVERAGEX (
    VALUES(DateTable[Date]),
    [DailyOccupancyRate]
)



Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Hi @bhanu_gautam ,

Thank you for help.
But it seems that it doesn't fit with my need. 

Randcharles_0-1722857404172.png

 

Hi @Randcharles ,

 

Your calculation is based on your data model and your tables. Please share a sample file with us.

We need to know how to calculate Number of reservation and Available desk.

You can also show us the result you want, this will make it easier to find the solution.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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