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
joku
Frequent Visitor

Hi , how can I get the average or median of filtered values

Hi , how can I get the average (or median) of lets say 10 filtered values where the top 2 and smallest 2 values have first been filtered out (in a certain time frame).

 

An Example :

I have a table with dates and values for each date. i select a time frame using a slicer.

The result is 

11
5
13
2
15
3
17
18
9
10

 

Using average I get -> 10,3

But I need to get the average of the values 3rd to 8th (so I need to drop 1st,2nd,9th,10th values from the calculation) and get 11,33333333 as a result for the average. This average I would need to get as an result in my result table.

I guess a DAX formula could do it but I can't figure out how.

Thanks

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @joku,

 

AFAIK, current power bi not support dynamic calculated column/table based on slicer/filter.

Calculated Column/Table Change Dynamically According to Slicer Selection in the Report.

 

Regards,

Xiaoxin Sheng

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

HI @joku,

 

You can simply use allselected with averagex/medianx functions to achieve your requirement.

Sample measures:

AVG of Selected Value=
AVERAGEX ( ALLSELECTED ( table[ColumnName] ), [ColumnName] )

MED of Selected Value=
MEDIANX ( ALLSELECTED ( table[ColumnName] ), [ColumnName] )

 

Regards,

Xiaoxin Sheng

That is close but what if I don't have a selection.  I rather wan't to show all medians in a table where those filterings have been done on specific groupings and it should also bee dynamic with selectiions on those groupings.

Anonymous
Not applicable

Hi @joku,

 

AFAIK, current power bi not support dynamic calculated column/table based on slicer/filter.

Calculated Column/Table Change Dynamically According to Slicer Selection in the Report.

 

Regards,

Xiaoxin Sheng

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