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
jen8080
Helper I
Helper I

Spread value across time between 2 dates

Hello-

 

I need to be able to determine the number of months betwen the start and end date and show how many employees I need to per month to fill these requested hours. The requested hours should be distrbuted evenly across the start and end dates. 

Each employee is expected to work 50 hours lets say. 

 

Here is just a sample of data to help:

Project IDRecord EntryRequested HoursWork End DateWork Start Date
Project 1144664Wednesday, December 23, 2020Wednesday, December 16, 2020
Project 11446620Wednesday, December 23, 2020Wednesday, December 09, 2020
Project 21399012Monday, August 31, 2020Wednesday, June 10, 2020
Project 21399050Monday, August 31, 2020Wednesday, June 10, 2020
Project 213990175Monday, August 31, 2020Wednesday, June 10, 2020
Project 213990692Monday, August 31, 2020Wednesday, June 10, 2020
Project 21399040Monday, August 31, 2020Wednesday, June 10, 2020
Project 213990125Monday, August 31, 2020Wednesday, June 10, 2020
Project 21399020Monday, August 31, 2020Wednesday, June 10, 2020
Project 31358610Thursday, March 31, 2022Tuesday, March 10, 2020
Project 4141251Monday, August 31, 2020Friday, July 31, 2020
Project 4141256Monday, August 31, 2020Monday, July 27, 2020
Project 4141256Monday, August 31, 2020Monday, July 27, 2020
Project 4141254Monday, August 31, 2020Monday, July 27, 2020
Project 41456119Friday, February 26, 2021Monday, February 08, 2021
Project 41425814.5Friday, January 08, 2021Thursday, October 01, 2020
Project 41425825Friday, January 08, 2021Thursday, October 01, 2020
Project 41425853.5Friday, January 08, 2021Thursday, October 01, 2020
Project 41425818Friday, January 08, 2021Thursday, October 01, 2020
Project 41425818Friday, January 08, 2021Thursday, October 01, 2020
Project 41456119Friday, February 26, 2021Monday, February 08, 2021
Project 41456166.5Friday, February 26, 2021Monday, February 08, 2021

 

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

  1. Why are there multiple rows for the same Project ID and Record Entry combination?
  2. As an example, for the first 2 rows, how would you calculate the number of months?
  3. Also, for project 4 and record entry 14258, how would you calculate the number of months?

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

1. This is just a sample sample of a much larger confidential dataset. Each study can have several requests for more hours to be added.

2.Again small  sample of the acutal dataset so we could use days if months aren't possible.

3. above is also applicable for this.

Hi @jen8080,

I still not so clear for your scenario, can you please share more details about these?

How to Get Your Question Answered Quickly 
#1, Did these request hours means the daily works hour that assigns in the date ranges?

#2, For the records with the same 'project id' and 'Record Entry', did these need to be summarized or calculate standalone?

#3, Since you are talking about working hours, how the weekend(workday range) configured in your date range?

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
v-shex-msft
Community Support
Community Support

Hi @jen8080,

It seems like a common multiple date range analysis requirement, please take a look at the following links if they meet your scenario:

Spread revenue across period based on start and end date, slice and dase this using different dates 

Before You Post, Read This#“start date” and “end date” 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
xMikeDx
Frequent Visitor

your time req in months is not going to fly when you are looking at partial months especially at both ends.

i believe you need to use datediff to get the count of days filter out any non workdays then determin how many hours per day each row is projected to meet your est. 50.

 

this is psudeo code.

measure =: 

var __hours = 50

var __dayrange = calculate(datediff (facttable[start_date], facttable[end_date], Day),'datetable'[isweekend]=false)

var __result = divide( __dayrange, __hours)

return __result

 

something like this

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.