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
askspepsi
Helper II
Helper II

Sum of Total hours in the next column

 

Dear All,

 

I have the below Table and I wanted to add the total hours for one employee in month-wise and add in the next column and calculate the CTC allocation according, Please help me I tried every possible I know.

My Table

IdMonthHoursCTC
1Jan101000
1Jan51000
1Feb251100
1Feb101100
2Feb101300
2Feb151300
2Mar301500
2Mar401500

 

Desired Output

IdMonthHoursCTCTotal HoursCTC Allocation
1Jan10100015        666.67
1Jan5100015        333.33
1Feb25110035        785.71
1Feb10110035        314.29
2Feb10130025        520.00
2Feb15130025        780.00
2Mar30150070        642.86
2Mar40150070        857.14
2 ACCEPTED SOLUTIONS
Fowmy
Super User
Super User

@askspepsi 

Add the following column:

Column = 
DIVIDE(
    Table4[CTC],
    CALCULATE(
        SUM(Table4[Hours]),
        ALLEXCEPT(Table4,Table4[Id],Table4[Month])
    )
) * [Hours]

 

Fowmy_0-1622117867290.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

Jihwan_Kim
Super User
Super User

Hi, @askspepsi 

Please check the below picture and the sample pbix file's link down below.

It is for creating measures, not columns.

 

Picture2.png

 

Total Hours Measure =
CALCULATE (
SUM ( 'Table'[Hours] ),
ALLEXCEPT ( 'Table', 'Table'[Id], 'Table'[Month] )
)
 
 
CTC Allocation =
SUM('Table'[CTC]) * (SUM('Table'[Hours]) / [Total Hours Measure])
 
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi, @askspepsi 

Please check the below picture and the sample pbix file's link down below.

It is for creating measures, not columns.

 

Picture2.png

 

Total Hours Measure =
CALCULATE (
SUM ( 'Table'[Hours] ),
ALLEXCEPT ( 'Table', 'Table'[Id], 'Table'[Month] )
)
 
 
CTC Allocation =
SUM('Table'[CTC]) * (SUM('Table'[Hours]) / [Total Hours Measure])
 
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Fowmy
Super User
Super User

@askspepsi 

Add the following column:

Column = 
DIVIDE(
    Table4[CTC],
    CALCULATE(
        SUM(Table4[Hours]),
        ALLEXCEPT(Table4,Table4[Id],Table4[Month])
    )
) * [Hours]

 

Fowmy_0-1622117867290.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.