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

Average & Weighted Average - help needed

Hi Community

 

I'm seeking help with calculating an average and weighted average in my Power BI model.  The excel file below shows what I'm trying to achieve.  Thanks in advance for any guidance you can offer.

 

Excel File

PBIX

3 REPLIES 3
Highlighted
Super User III
Super User III

Re: Average & Weighted Average - help needed

The first thing I thought when I saw the data was "well, we've got to unpivot those columns" and then I looked at the transforms and see that they had just been pivoted.  So, remove that step.

You could split the 'Nominal - Dec' to get a column that indicates job role e.g. Graduate.

The 'CY Total' can then become

CY Total = CALCULATE(SUM(TableSalary[Base Amount]), TableSalary[Accounting Period] = "2019/001")

and PY Total can be re-written similarly.

%Increase can stay.

Weighted average would be

Weighted Av = [% Increase] * [CY Total]

 

You can pull all the relevant fields into a matrix with 'job role' in the column and employee in the rows.

All the Totals and sub-totals will give you the figures you want.

 

Alternatively, to see the data in more compact form, create two tables 1 - Role, weighted av, % increase

2 - Employee, Role, all the measures

------------------------------

For a more complex data set, you could implement the measures using time intelligence rather than filtering the table with hardcoded years i.e. "2019/001"

 

Hope that helps.

Highlighted
Frequent Visitor

Re: Average & Weighted Average - help needed

Hey @HotChilli 

 

I can't thank you enough. Your suggestions were spot on, nailing my issues right there.  can I be super cheeky and ask for your help again with the weighted average?  This formula:

Weighted Av = [% Increase] * [CY Total]

 

actually gives the answer to my NI/Share Profit calculation.  Is the Weighted Average in my Excel file doable?

 

Thanks!

Highlighted
Super User III
Super User III

Re: Average & Weighted Average - help needed

I'll have a go.  How is it calculated?

Helpful resources

Announcements
Meet the 2020 Season 2 Power BI Super Users!

Meet the 2020 Season 2 Power BI Super Users!

Find out who's part of the program this season, and welcome the new Super Users.

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!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Featured Data Story of The Month

Featured Data Story of The Month

All Data Stories Gallery contributions are reviewed for each month. We select a contribution and feature the community member the following month.

Power BI Dev Camp - Developing with .NET Core

Power BI Dev Camp - Developing with .NET Core

Learn how to develop custom web applications for Power BI using .NET Core 3.1 and .NET 5.

Top Solution Authors
Top Kudoed Authors