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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Add column with average per category

 

Hi,

 

I am a newbie at Powerbi. I want to have the average price per category.

But I don´t want to create a measure, as for me it has to be a fixed table. I manage to create a Measure, but then I can not the (price-average_price). I´d like to create a new column with the calculated field. But don´t know-how. 

The table should look something like this, and I need to add average_price to the table.

 

id        price  category     average_price

32141  100  050055555      75

32141    50  050055555      75

 

42421   300  030010402    283
42422   290  030010402    283
30074   250  030010402    283
42512   300  030010402    283
30289   250  030010402    283
49993   310  030010402    283

 

Thanks in advance

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Try this calculated column formula

Average_Price = calculate(average(Data[Price]),filter(Data,Data[category]=earlier(Data[category])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

thanks mate, really helped me!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

Try this calculated column formula

Average_Price = calculate(average(Data[Price]),filter(Data,Data[category]=earlier(Data[category])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
jaipal
Resolver III
Resolver III

@Anonymous  hi, try this in your calculated colum

Column = (calculate( AVERAGE('Table'[price]) ,FILTER('Table', 'Table'[category] = MAX('Table'[category]))))

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors