cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Average Cost per ID and Month

Hi all,

 

I tried searching in the community but nothing has either helped or was specific to my problem. 

 

I have data in the following format and I need to calculate the adjusted average salary per month. (adjusting for % working time, i.e. salary * % working time).

 

Person IDSalary% Working Time Effective DateMonthAdj. Salary
12310001001.4.20204?
12310009015.4.20204?
1231000801.5.20205?
1231000701.6.20206?
9992000501.4.20204?
9992000401.5.20205?
9992000301.6.20206?

 

The adj. salary should be aggregrated by person and month.

Any help is greatly appreciated!

 

Thanks in advance and best,

Max 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: Average Cost per ID and Month

Hi @maxabele ,

 

Create 2 calculated Columns

 

 

Adjusted Salary = 'Table'[Salary] * DIVIDE('Table'[% Working Time ],100)
 
 
AverageC =
CALCULATE(AVERAGE('Table'[Adjusted Salary]),ALLEXCEPT('Table','Table'[Person ID],'Table'[Month]))
 
 
Create 2 Measure
 
Maxxx = CALCULATE(MAX('Table'[AverageC]),ALLEXCEPT('Table','Table'[Month],'Table'[Person ID]))
 
Measure = CALCULATE(SUMX(DISTINCT('Table'[Person ID]),[Maxxx]))
 
 
1.jpg2.JPG
 
 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

View solution in original post

6 REPLIES 6
Highlighted
Community Champion
Community Champion

Re: Average Cost per ID and Month

Hi @maxabele ,,

 

Are you looking for something like this?

 

1.jpg

 

Can you share the expected output.

 

Regards,

Harsh Nathani

 

 

Highlighted
Frequent Visitor

Re: Average Cost per ID and Month

Hi Harsh, thank you for your response. 

 

The expected output is:

Salary Cost = 1000* 95% (Average 100 & 90) + 2000*50% = 1950

 

MonthSalary Cost
41950
51600
61300
Highlighted
Super User IV
Super User IV

Re: Average Cost per ID and Month

@maxabele , Try like

New column =table[Salary]*table[% Working Time]/100.0

 

New Measure =sumx(Table, table[Salary]*table[% Working Time]/100.0)



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

Highlighted
Frequent Visitor

Re: Average Cost per ID and Month

Thank you! With your formula, it's adding the rows for the same person and month up. For instance, in this example for employee 123 the result for month 4 is: 1900 instead of 950. 

Highlighted
Community Champion
Community Champion

Re: Average Cost per ID and Month

Hi @maxabele ,

 

Create 2 calculated Columns

 

 

Adjusted Salary = 'Table'[Salary] * DIVIDE('Table'[% Working Time ],100)
 
 
AverageC =
CALCULATE(AVERAGE('Table'[Adjusted Salary]),ALLEXCEPT('Table','Table'[Person ID],'Table'[Month]))
 
 
Create 2 Measure
 
Maxxx = CALCULATE(MAX('Table'[AverageC]),ALLEXCEPT('Table','Table'[Month],'Table'[Person ID]))
 
Measure = CALCULATE(SUMX(DISTINCT('Table'[Person ID]),[Maxxx]))
 
 
1.jpg2.JPG
 
 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

View solution in original post

Highlighted
Frequent Visitor

Re: Average Cost per ID and Month

Works fantastic, thank you so much!!

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Super Users of the Quarter - Q2 2020

Super Users of the Quarter - Q2 2020

Who are our Super User Superstars? Who made it to the top of the leaderboards? Get the answers!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Community Summit Australia – Join Online!

Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors