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
Andrei_Fleancu
Regular Visitor

Calculating yearly/ monthly days between a

Hello,

 

I am trying to calculate or adding a new column to calculate total rented days/ 2022. I managed to calculate the total rented days / rental contract , by substracting End_date - Start_date. 

 

Now i want to calculate/ add the rent days either monthly (of 2022) or yearly but I cannot manage to do it because for example there are rent contracts rented activated since 2019, which are still active in 2022, but for me I need only the days rented in 2022 (not the whole period since 2019) -> same for monthly - I have active contracts since december 2021 ended in january 2022 - needs to add only the rented days in january, not the whole period of active contract. 

Thank you !

 

1 REPLY 1
amitchandak
Super User
Super User

@Andrei_Fleancu , Based on what I got, Refer

 

Between Dates - Dates between
Measure way
Power BI Dax Measure- Allocate data between Range: https://youtu.be/O653vwLTUzM
https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-o...

Tables way
https://amitchandak.mediumcom/dax-get-all-dates-between-the-start-and-end-date-8f3dac4ff90b
https://amitchandak.medium.com/power-query-get-all-dates-between-the-start-and-end-date-9ad6a84cf5f2

 

 

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.

Top Solution Authors