Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
timflo
New Member

How to create a table with average weights by group

Hi all, 

 

I'm trying to create a table in Power BI that I have created manually already. Here is the situation:

 

I have 3 adresses where we have 1 or multiple boxes to collect something. We collect every 2 weeks. For Example

 

CityDateDevice IDAdressWeight
Amsterdam23/11/2021111Johnson street 250
Amsterdam23/11/2021112Johnson street 260
Amsterdam23/11/2021113Johnson street 270
Amsterdam23/11/2021114Williamson lane 1055
Amsterdam23/11/2021115Rogers road 465
Amsterdam07/12/2021111Johnson street 280
Amsterdam07/12/2021112Johnson street 275
Amsterdam07/12/2021113Johnson street 290
Amsterdam07/12/2021114Williamson lane 1065
Amsterdam 07/12/2021115Rogers road 450

 

Here is the problem: I need to know the total average weight per adress over time. So for example Johnson street's total weight the first time is 180 and the second time 245 giving an average of 180 + 245 / 2 = 212,50 per collection. Power BI however gives me the average value of the independent rows (so avg 60 for the first pickup and avg 81,6 for the second pickup. 

 

Is there a way to add up the weights before calculating the average and this way get a total average per adres per pickup? 

 

Thank you very much!

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@timflo , Try a measure like

AverageX(summarize(Table, Table[Adress], Table[Date], "_1", Sum(Table[Weight])),[_1])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new table.

 

Picture1.png


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

5 REPLIES 5
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new table.

 

Picture1.png


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
tamerj1
Super User
Super User

@timflo 

Yeat this doable. But how does you report looks like?  I guess you want to aggregate the results by adress? Or you also intersted of having moving average based on dates?

Hi Tamerj, 

 

By report, do you mean the powerBI visuals or the raw data. The latter is an excel file with data bi-weekly data entries with the following colums:

City

Date

Weekday

Weeknumber

Month

Year

Location ID (= device ID)

Adress

Zip code

Province

Country

Location (= CONCATENATE)

Audience

Net weight

Polluted (yes/no)

 

Right now we're handling 1 city but we're going to expand and I'd like to compare data, especially:

Average collected weight per adress per pick-up (every 2 weeks)

Average collected weight per household (= number of households on that adress) per pick-up

Average collected weight per household per year (= previous number * 26 weeks)

 

Hope this helps. 

 

Thank you.

amitchandak
Super User
Super User

@timflo , Try a measure like

AverageX(summarize(Table, Table[Adress], Table[Date], "_1", Sum(Table[Weight])),[_1])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amitchandak, 

 

This seemed to have worked! I now have 3 adress lines with the correct values. Can you help me in the next step? 

 

Adress 1 has 150 apartments

Adress 2 has 43 apartments

Adress 3 has 35 apartments

 

I created a simple table with 2 colums and the above information and linked the tables based on adress. How can I now:

1. calculate and visualize this average weight per household per pick-up

2. calculate and visualize this average weight per household per year (= the value from 1 times 26 weeks since the pick-ups are every other week)

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.