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
SteveChoj
New Member

Days between two dates : But only the value of one month

Hi dear Community,

 

I would have to calculate the occupancy, i.e. person X has occupied bed Y from date X to date Y in days Z.
Ex :

 

SteveChoj_0-1680527457092.png

 

 

You have Date/Heure Entrée Séjour and Date/Heure Sortie Séjour, first example : from 27/01/2022 to 25/03/2022 are 57 Days.

But now I only need 

January -> 4 Days

February -> 28 Days

March -> 25 days.

I need this in the form of a table - where all months are included and I can see the occupancy per month.
How would you proceed? I am completely lost at the moment...

 

Thanks 🙂

 

1 REPLY 1
amitchandak
Super User
Super User

@SteveChoj , refer if these can help

 

Measure way
Power BI Dax Measure- Allocate data between Range: https://youtu.be/O653vwLTUzM


Table 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

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.