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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Bill_NYC
Regular Visitor

How to get an average of sums?

I have a table of numbers (x)  by item and year-month.  I want to sum by year-month, then take the average of the sums.  My simple-minded approach is roughly:

 

var tbl1 = addcolumns(summarize('My table', 'My table'[Year-month]),"x",sum('My table'[My number]))

var result = average(tbl1[x])

 

I get the base table is expected error and am not sure where to go from here...

3 REPLIES 3
Anonymous
Not applicable

Hi  @Bill_NYC ,

I created some data:

vyangliumsft_0-1661226316544.png

Here are the steps you can follow:

1. Create calculated column.

Avg 
var _table1=
SUMMARIZE('Table','Table'[Year-month],"x",SUM('Table'[Amount]))
return
AVERAGEX(_table1,[x])

2. Result:

vyangliumsft_1-1661226316546.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

tamerj1
Super User
Super User

Hi @Bill_NYC 

use AVERAGEX ( tbl1, [x] )

My original post was not clear so let me redescribe what I am trying to go:

 

Bill_NYC_0-1661781364768.png

 

Step 1 Count # of customers per year
Step 2 Get market pop per year
Step 3 Get # of customers/pop per year per market = penetration %
Step 4 Get average penetration % across years for each market

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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