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
rush
Helper V
Helper V

Sum Billable Hours (Numeric) per Year-Month (Data type = Text) then DIVIDE by a specific Number?

I would like to know how to sum up all my Billable Hours (Numeric) per Year-Month (Data type = Text) then DIVIDE that by the No. of Working Days (Numeric) in that month.

 

e.g. Total billable hours for 16-01 = 480 THEN DIVIDE by No. of Working Days for that Year-Month being 20 = 24

 

I have 3 coumns of data:

 

Billable Hours         Year-Month       No. of Working Days

160                         16-01                   20

160                         16-01                   20

8                             16-02                   21

8                             17-01                   22

160                         16-01                   20

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @rush,

 

If you want to add an extra column in above table to show the expected result, please create a calculated column referring to this formula:

Result =
DIVIDE (
    CALCULATE (
        SUM ( 'Sum Bill'[Billable Hours] ),
        ALLEXCEPT ( 'Sum Bill', 'Sum Bill'[Year-Month] )
    ),
    'Sum Bill'[No.of working days]
)

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yulgu-msft
Employee
Employee

Hi @rush,

 

If you want to add an extra column in above table to show the expected result, please create a calculated column referring to this formula:

Result =
DIVIDE (
    CALCULATE (
        SUM ( 'Sum Bill'[Billable Hours] ),
        ALLEXCEPT ( 'Sum Bill', 'Sum Bill'[Year-Month] )
    ),
    'Sum Bill'[No.of working days]
)

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yulgu-msft Thanks, the code works. Much appreciated.

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.