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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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