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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Sum of Occupation Days per Resource in given Month

Dear Community,

 

I am struggling with a formula for the Occupation of Resources per Month.

My current formula:

 

Occupied Days WithIn Month =
VAR StartDate = VALUE( SELECTEDVALUE( 'Resource Assignments'[Start] ) )
VAR FinishDate = VALUE( SELECTEDVALUE( 'Resource Assignments'[Finish] ) )
VAR MinDateInContext = VALUE( MIN( 'Calendar'[Date] ) )
VAR MaxDateInContext = VALUE( MAX( 'Calendar'[Date] ) )

RETURN
IF( AND( StartDate < MinDateInContext, FinishDate > MinDateInContext ) ,
        MIN( FinishDate, MaxDateInContext ) - MinDateInContext,
            IF( AND( AND( StartDate > MinDateInContext, StartDate < MaxDateInContext ), FinishDate > MinDateInContext ),
                 MIN( FinishDate, MaxDateInContext ) - StartDate,
                    BLANK() ) )
 
This basically gives me the right thing, I only need to add something to finalize it. My Matrix visual looks like this:
*All numbers of days and dates are used as examples
 
Resource     - Jan 23 - Feb 23 - Mar 23
Resource A      5 days
Resource B                   10 days
 
Problem A) is this formula doesn't calculate the SUM of Occupation Days per Resource, so when a Resource works on task 1 for the first 5 days of January and also works on task 2 the last 5 days of January, the formula gives 5 Occupation days, but ofcourse I need 10.
 
Problem B) is that this formula doesn't work when a Resource works on task 1 the last 10 days of January until the 10th day of February. In this case the formula should give 10 Occupation days in Jan and also 10 in Feb (in the Matrix visual), but instead the formula gives the 10 of Jan and skips the 10 in Feb as a whole.
 
Hopefully you can grasp my situation here. If not clear, I will come back with a sample file.
 
All best,
Fabian
2 REPLIES 2
v-binbinyu-msft
Community Support
Community Support

Hi @Anonymous ,

In order to better understand your demands and give the right solution, could you please provide some more specific information? such as your desensitized example data and a screenshot of your desired results?

Thanks for your efforts & time in advance.

 

Best regards,
Community Support Team_ Binbin Yu

 

Anonymous
Not applicable

Hello,

 

I created this little sample table. My actual data is imported and synced to Project for the Web. 

 

Resource       Start          Finish        Task       Occupied Days   
Resource A2/1/202313/1/23Task A10
Resource B9/1/20233/2/2023Task B20
Resource A23/1/2327/1/23Task C5

 

What I need is a matrix view that looks like the following:

Resource   

Jan'23  Feb'23  Mar'23  
Resource A    15  
Resource B    17    3 

The value numbers represent the amount of days a resource is occupied in total (tasks combined), calculated per month.

 

In my formula mentioned in the first message it would give value 10 days in Jan 23 for Resource A, and not calculate the sum (=15). For Resource B it would give only the 17 in Jan 23 and does not calculate the days that are in the next month due to overlap.

 

Any ideas how to fix this?

 

Best,

Fabian

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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