Forum

Weighted average
 
Notifications
Clear all

Weighted average

2 Posts
2 Users
0 Reactions
87 Views
(@matt-jonsson)
Posts: 25
Eminent Member
Topic starter
 

Hello,

 

I'm having trouble of getting a calculation to work in Power BI.

 

I have some tables with electricity consumption data (Hourly). I also have the electricity prices hourly. I want to be able to:

- Calculate the cost of energy, which in the Power BI file would be: Bought electricity x Electricity Price (SE4 kr/kwh Ink moms), for every row. This I want to be able to aggregate to daily, monthly and yearly costs. 

- I also would like to be able to present the average electricity price (SE4 kr/kWh inkl moms). It will be different on daily basis, depending on how much electricity have been used in every hour. If a lot of energy has been bought when electricity price is low, the daily average will be lower. I'd like to be able to aggregate this to daily, monthly and yearly averages. Again, depending on hourly lever of bought electricity (kwh) and electricity price n hourly level.

I have tried both DAX and the Quick measure "Weighted avareage", but I don't get it to work. Will I need one calculation for each level (daily, monthly, yearly), or is it possible to cover it all in one measure?

I cant upload the pbx-file despite it being 1,3MB... Please find attached print screens. 1.JPG2.JPG3.JPG4.JPG

Thank you and have a nice weekend!

 
Posted : 26/03/2022 11:32 am
(@mynda)
Posts: 4762
Member Admin
 

Hi Mattias,

It doesn't sound like you want a weighted average, just a regular average either by day, month or year. Have you tried using AVERAGEX?

You can email the file if you still have questions.

Mynda

 
Posted : 27/03/2022 7:48 am
Share: