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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Euto
Frequent Visitor

How to find the Sum of number days in month between two dates

Hello, I would need help in figuring out how to calculate occupancy rate given the following sample data.

- There's 1 City, and 4 Stores.

 

CityStoreStatusStartDateEndDate
Occupied January 10, 2020 August 15, 2020 
Occupied August 26, 2020 December 31, 2020 
Occupied January 1, 2020 May 3, 2020 
Occupied May 21, 2020 May 22, 2020 
Occupied May 23, 2020 August 9, 2020 
Occupied August 20, 2020 December 31, 2020 
Occupied January 1, 2020 August 25, 2020 
Occupied August 26, 2020 December 31, 2020 
Occupied January 1, 2020 May 9, 2020 
Occupied May 10, 2020 December 31, 2020 

 

See below what the desired result will be, the Occupancy Rate is what I desire to have.

 

Desired Result.png

 

 

This is only a sample data, in the actual dataset number or cities are over 100, each of those cities could have 4 - 144 stores each, and the period looked on is over 3 year period(2017, 2018, 2019, 2020).

- I would prefer not to go the route of listing the dates between start and end date in power query.


Additional Edit after initial post:
Sorry I made some changes to dates and changed the desired result to show some vacancy in Jan , May and Aug.

 

 

Thanks in advance.

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@Euto - I'm going to mock this up but I am fairly certain this is a variation on the Overlap pattern I just posted to the Quick Measures Gallery recently. https://community.powerbi.com/t5/Quick-Measures-Gallery/Overlap/td-p/1372369



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.