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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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