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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Find average total spend for each ID

I want to create a measure that finds the average of the total_spend for each ID. My table looks like this:

 

ID Total_Spend 
1234 £             34.00
1234 £             34.00
1234 £             34.00
4325 £             56.00
4325 £             56.00
4325 £             43.00
4325 £             43.00
5678 £             12.00
5678 £             12.00

 

I've tried:

 

 

AvgIDSpend=
AVERAGEX (
SUMMARIZE (
Table,
Table[ID],
"Total Average", SUM( DISTINCT ( Table[Total_spend] )
),
[Total Average]
)

 

 

 

But got this error- The SUM function only accepts a column reference as an argument.

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Try like

 

 AvgIDSpend=
AVERAGEX (
SUMMARIZE (
Table,
Table[ID],
"_1", Sumx(Values(Table[Total_spend]), [Total_spend])
),
[_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
Anonymous
Not applicable

Unfortunately, that gives me the average spend across all ID's, not each one. So when I put it on a table I get the same average for every ID

Anonymous
Not applicable

Hi @Anonymous ,

 

I think amitchandak's code could work. Here I have a test by creating a measure by his code in my sample.

RicoZhou_0-1657098254851.png

If this reply still couldn't help you solve your problem, please show me a screenshot with the result you want. This will make it easier for me to find the solution.

 

Best Regards,
Rico Zhou

 

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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.