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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Raja_Rizwann
Regular Visitor

Dax for Vacant days calculation

Dear all, 

I am new to power BI and self learning from different platforms. I am facing an issue in calcualtion of "Vacant Days " in  a simple database for Property Management. any one can help me to write a Dax ( Calculated Colum or Dax ) to Calculate the total Vacant Days of each individual apartment . Table is Copy pasted below. Some rows are colored Blue showing the same apartment no Repeated . 

Tenant NameTenant IDApt NoMove inMove outTenants StatusApt StatusVacant Days
Tenant16110110106-Jul-2306-Jul-24Move outVacant 
Tenant26110210216-Jul-2316-Jul-24Move outVacant 
Tenant36110310326-Jul-2326-Jul-24Move outVacant 
Tenant46110420105-Aug-2305-Aug-24Move outVacant 
Tenant56110520215-Aug-2315-Aug-24Move outVacant 
Tenant66110620325-Aug-2325-Aug-24Move outVacant 
Tenant76110730104-Sep-2304-Sep-24Move outVacant 
Tenant86110830214-Sep-2314-Sep-24Move outVacant 
Tenant96110930324-Sep-2324-Sep-24Move outVacant 
Tenant106111040104-Oct-2304-Oct-24Move outVacant 
Tenant116111140214-Oct-2314-Oct-24Move outVacant 
Tenant126111240324-Oct-2324-Oct-24Move outVacant 
Tenant136111350103-Nov-2303-Nov-24Move outVacant 
Tenant146111450213-Nov-2313-Nov-24Move outVacant 
Tenant156111550323-Nov-2323-Nov-24Move outVacant 
Tenant166111660103-Dec-2303-Dec-24Move outVacant 
Tenant176111710113-Dec-2313-Dec-24activeRented 
Tenant186111860323-Dec-2323-Dec-24activeRented 
Tenant196112210102-Jan-2402-Jan-25activeRented 
Tenant206112370212-Jan-2412-Jan-25activeRented 
1 ACCEPTED SOLUTION
ThomasWeppler
Super User
Super User

Table is a placeholder name
Make a new  column like this
Number of Days =
DATEDIFF ( table[Move in], table[Move out], DAY )


Than make a DAX code
Total number of vacant days =
CALCULATE ( SUM ( Table[Number of Days] ), StatusApt = Vacant )

 

I hope this help 🙂

 

View solution in original post

4 REPLIES 4
Raja_Rizwann
Regular Visitor

I am waiting for the solution. Issue not resolved yet. Any one can help

ThomasWeppler
Super User
Super User

Table is a placeholder name
Make a new  column like this
Number of Days =
DATEDIFF ( table[Move in], table[Move out], DAY )


Than make a DAX code
Total number of vacant days =
CALCULATE ( SUM ( Table[Number of Days] ), StatusApt = Vacant )

 

I hope this help 🙂

 

Thank you Sir for the response. 

This gives number of occupancy days, Vacant days will be the difference between move out date and Next Move in Date of any apartment. thats why i have colored apartment no 101 as blue. 

I don't understand this message. Can you try to rephrase it?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.