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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
AMPAllie
Helper II
Helper II

Data Based on Dates

I have a dataset that is "Planned labor Hours" for a date range (start and end date).   I have created columns that calculate planned hours per workday and planned hours per week. 

What I need to accomplish is a result that is a Matrix with week date ranges as column headers (or just the Start date of the week), and number of hours per week as the values.  I have a calendar table that includes a "Start of week" date.

 Ugh.png

 

1 ACCEPTED SOLUTION

First, to answer your question:

To calculate those fileds was a multistep process. First I had to create a column for the number of workdays in the date range:

Net Work Days = CALCULATE(SUM(Dates[IsWorkday]),
DATESBETWEEN(Dates[Date],
RPAssignment[StartDate],
RPAssignment[EndDate] )
)
Then Daily Hours
Daily Hours = [PlannedLaborHrs]/[Net Work Days]
Then Weekly Hours
Weekly Hours = [Daily Hours]*7
 
Second, I found a long, tedious, round-about way to accomplish what i want. Then it turned out it's not what the client wanted. So i am marking this solved.
 
 

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @AMPAllie

How do you create columns that calculate planned hours per workday and planned hours per week?

 

From the screenshot, "Planned labor Hours" calculate for many weeks and workdays. also, it overlapping with dates for the third and fourth rows in the screeshot.

 

How do i allocate the "Planned labor Hours" for week date ranges  in your matrix?

 

Best Regards

maggie

 

First, to answer your question:

To calculate those fileds was a multistep process. First I had to create a column for the number of workdays in the date range:

Net Work Days = CALCULATE(SUM(Dates[IsWorkday]),
DATESBETWEEN(Dates[Date],
RPAssignment[StartDate],
RPAssignment[EndDate] )
)
Then Daily Hours
Daily Hours = [PlannedLaborHrs]/[Net Work Days]
Then Weekly Hours
Weekly Hours = [Daily Hours]*7
 
Second, I found a long, tedious, round-about way to accomplish what i want. Then it turned out it's not what the client wanted. So i am marking this solved.
 
 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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