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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rhiheu
Helper I
Helper I

Average of filtered values (filtered from value in another column)

Hi, I would like to create an average value from a filtered set of rows, where the value in another field = "Boats".

i.e. I have all the amounts in one column, but some of these are for (e.g.) planes, some for boats, some for cars. And the vehicle type is recorded in another column. So looking to create an average for each vehicle type.

E.g. BoatAverageAmount = average of the amount field in rows where vehicletype = "Boat".

Would this be a column or a measure? And what would be the DAX?

Thanks for your help.

2 ACCEPTED SOLUTIONS
wdx223_Daniel
Super User
Super User

=CALCULATE(AVERAGE(Table[Amount]),Table[Vehicle Type]="Boat")

View solution in original post

create calculated column, please try this

new column=AVERAGEX(FILTER(Table,Table[Vehicle Type]="Boat"),Table[Amount])

View solution in original post

4 REPLIES 4
wdx223_Daniel
Super User
Super User

=CALCULATE(AVERAGE(Table[Amount]),Table[Vehicle Type]="Boat")

Thanks! I get an error when trying to use this formula in a column for each vehicle average ('A circular dependency was detected') but it seems to work fine as a measure.

create calculated column, please try this

new column=AVERAGEX(FILTER(Table,Table[Vehicle Type]="Boat"),Table[Amount])

That works perfectly, thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors