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
Anonymous
Not applicable

Splitting hours between working days

Hi

 

I've been sent on a task to make a capacity plan for the production.

 

I have a table with actual and budget hours for each production order. This yield a deviation, which are the the remaining hours for production. 

 

The number of remaining hours should then be split into pieces of max 7,4 hours until there is no remaining production orders.

 

bi 06-05-.PNG

 

Is this achieveable somehow?

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

One sample for your reference. Please check the following step as below.

 

1. Create a date table as below.

Table = var k =CALENDAR(DATE(2019,05,01),DATE(2019,05,31))
return
FILTER(k,WEEKDAY([Date],2)<=5)

2. Crossjoin the two tables.

Table 2 = var k =CROSSJOIN('Table',Table1)
return
ADDCOLUMNS(FILTER(k,[Date]>=Table1[Real date]),"value",0-[remaining])

3, Create a calculated column in table 2.

Hrs = 
VAR ms =
    CALCULATE (
        COUNT ( 'Table 2'[order no] ),
        FILTER (
            'Table 2',
            'Table 2'[order no] = EARLIER ( 'Table 2'[order no] )
                && 'Table 2'[Date] <= EARLIER ( 'Table 2'[Date] )
        )
    ) * 7.4
VAR i = ms - 'Table 2'[value]
VAR result =
    IF ( 'Table 2'[value] > ms, 7.4, 7.4 - i )
RETURN
    IF ( result > 0, result, BLANK () )

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

One sample for your reference. Please check the following step as below.

 

1. Create a date table as below.

Table = var k =CALENDAR(DATE(2019,05,01),DATE(2019,05,31))
return
FILTER(k,WEEKDAY([Date],2)<=5)

2. Crossjoin the two tables.

Table 2 = var k =CROSSJOIN('Table',Table1)
return
ADDCOLUMNS(FILTER(k,[Date]>=Table1[Real date]),"value",0-[remaining])

3, Create a calculated column in table 2.

Hrs = 
VAR ms =
    CALCULATE (
        COUNT ( 'Table 2'[order no] ),
        FILTER (
            'Table 2',
            'Table 2'[order no] = EARLIER ( 'Table 2'[order no] )
                && 'Table 2'[Date] <= EARLIER ( 'Table 2'[Date] )
        )
    ) * 7.4
VAR i = ms - 'Table 2'[value]
VAR result =
    IF ( 'Table 2'[value] > ms, 7.4, 7.4 - i )
RETURN
    IF ( result > 0, result, BLANK () )

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

You're a genious btw. This is brilliant!

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.

Top Solution Authors