- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Calculate Weighted Average
Hi,
I am having difficulty in trying to calculate the weighted average from the dataset I have.
I have unpivoted the data in query editor due to the nature of the data in the source.
I want to work out the total weighted average per column e.g total weighted average for sp £/t, cos £/t and margin £/t. The Total row should show the weighted average
Expected:
Tonnes | SP £/t | COS £/t | Margin £/t | Margin £k | |
Downgrade | 50 | 2000 | 3000 | -800 | -50 |
Mouldy | 0 | 0 | 0 | 0 | 0 |
Traded | 20 | 4000 | 5000 | -1000 | -30 |
Total | 70 | 2571 | 3571 | -857 | -80 |
To calculate this for e.g sp £/t, i need to multiply tonnes by the sp £/t value so - ((52 * 2800) + (0*0) + (33*3030))/85
Below is the source table -
Week No | W/C | Attribute | Value |
47 | 20/11/2023 | Downgrade Tonnes | 50 |
47 | 20/11/2023 | Downgrade SP £/t | 2000 |
47 | 20/11/2023 | Downgrade COS £/t | 3000 |
47 | 20/11/2023 | Doiwngrade Margin £/t | -800 |
47 | 20/11/2023 | Downgrade Margin £k | -50 |
47 | 20/11/2023 | Mouldy Tonnes | 0 |
47 | 20/11/2023 | Mouldy SP £/t | 0 |
47 | 20/11/2023 | Mouldy COS £/t | 0 |
47 | 20/11/2023 | Mouldy Margin £/t | 0 |
47 | 20/11/2023 | Mouldy Margin £k | 0 |
47 | 20/11/2023 | Traded Tonnes | 20 |
47 | 20/11/2023 | Traded SP £/t | 4000 |
47 | 20/11/2023 | Traded COS £/t | 5000 |
47 | 20/11/2023 | Traded Margin £/t | -1000 |
47 | 20/11/2023 | Traded Margin £k | -30 |
Any help is appreciated!
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
08-29-2024 12:51 PM | |||
Anonymous
| 10-24-2017 12:51 PM | ||
01-30-2023 12:08 AM | |||
09-02-2024 07:12 AM | |||
08-27-2024 06:13 AM |
User | Count |
---|---|
109 | |
90 | |
82 | |
55 | |
46 |