Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.
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
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...
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
76 | |
74 | |
69 | |
47 | |
41 |
User | Count |
---|---|
63 | |
42 | |
30 | |
30 | |
28 |