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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
marcoscruz
New Member

occupancy

hello all

 

I am trying to calculate an occupancy report for the use of some resources, the final goal is to have how many days of the month the resource is used and also calculate the percentage of the month that the resource is used, so far I use the following measure, but the calculation is not correct, could you help me with that?

 

occupancy_days = CALCULATE(SUMX(SUMMARIZE(capacity_view,capacity_view[Start],capacity_view[End],
"occupancy_s",SUMX(capacity_view,DATEDIFF('capacity_view'[Start], capacity_view[End], DAY)),
"occupancy_e",SUMX(capacity_view,DATEDIFF('capacity_view'[Start], capacity_view[End], DAY))),
[occupancy_s]),USERELATIONSHIP(capacity_view[Start],'calendar'[Date]))
 
2022-01-18_23h34_18.png
 

Any suggestions are really appreciated

 

Thanks in advance

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@marcoscruz , refer if this blog can help

https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-o...

 

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

View solution in original post

2 REPLIES 2
marcoscruz
New Member

hello

 

yes, that works perfectly  I used the  following formula

 

Day by Month = CALCULATE(countx(SUMMARIZE(filter(CROSSJOIN('Data','Date'),'Date'[Date] >= 'Data'[StartDate] && 'Date'[Date]<= 'Data'[EndDate]),'Data'[id],'Date'[Date]),'Date'[Date]))

  thanks a lot

amitchandak
Super User
Super User

@marcoscruz , refer if this blog can help

https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-o...

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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