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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
elijah_gap
Frequent Visitor

DAX Slicer to show when metric is greater than the average of all

Hello! 

 

I have a list of people with metrics that are performance indicators in a table. 

 

I want to create a slicer that when selected, makes it so only the people who are below the overall average in every metric shows up in the table. 

 

Thanks! 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @elijah_gap ,

Because you didn't provide the test data and didn't provide the results you expected, I can't guarantee that the method I'm providing is what you want to see. If I can't understand what you mean, please forgive me and provide the test data and expected results, thank you!

I'll start by showing you the test data that I created myself:

vjunyantmsft_0-1699000940213.png

In order to give you a clearer view of the structure, I used the following two DAX functions to calculate the average of metricA and metricB:

Average_metricA = 
AVERAGEX(ALL('Table'),'Table'[metricA])
Average_metricB = 
AVERAGEX(ALL('Table'),'Table'[metricB])

vjunyantmsft_1-1699001000363.png

Here's the slicer I created by using this table:

vjunyantmsft_2-1699001028723.pngvjunyantmsft_3-1699001033047.png

 

First, we configure filtering for metricA , you can use the following DAX to create a new measure:

Select_metricA = 
var _avgA=
AVERAGEX(
    ALL('Table'),'Table'[metricA])
return
SWITCH(
    TRUE(),
    MAX('Table 1'[METRIC])="metricA",
IF(
    MAX('Table'[metricA]) < _avgA,1,0)
)

Click on the test data table you created earlier, drag the new measure you just created into the Filters on this visual in Filters:

vjunyantmsft_4-1699001116408.pngvjunyantmsft_5-1699001123573.png

vjunyantmsft_7-1699001169277.png

After you click the ‘Apply filter’, then choose the ‘metricA’ in the silcer, the final output is shown in the following figure:

vjunyantmsft_8-1699001210650.png

All those whose metricA is less than the average of metricA are shown up.
Steps are the same for filtering metricB, but before you filter B, don't forget to make the criteria for filtering A clear!

vjunyantmsft_11-1699001535172.png

MetricB's DAX is as follows:

Select_metricB = 
var _avgB=
AVERAGEX(
    ALL('Table'),'Table'[metricB])
return
SWITCH(
    TRUE(),
    MAX('Table 1'[METRIC])="metricB",
IF(
    MAX('Table'[metricB]) < _avgB,1,0)
)

The final output of metricB is shown in the following figure:

vjunyantmsft_10-1699001307751.png

That's the solution for you. Finally, if I misunderstand what you mean, please forgive me and provide the test data and expected results, and I will continue to try to find a workaround for you.

Best Regards,

Dino Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

 

 

 

 

 

View solution in original post

Exactly what I was looking for ! Thank you so much for the incredibly detailed explination! 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @elijah_gap ,

Because you didn't provide the test data and didn't provide the results you expected, I can't guarantee that the method I'm providing is what you want to see. If I can't understand what you mean, please forgive me and provide the test data and expected results, thank you!

I'll start by showing you the test data that I created myself:

vjunyantmsft_0-1699000940213.png

In order to give you a clearer view of the structure, I used the following two DAX functions to calculate the average of metricA and metricB:

Average_metricA = 
AVERAGEX(ALL('Table'),'Table'[metricA])
Average_metricB = 
AVERAGEX(ALL('Table'),'Table'[metricB])

vjunyantmsft_1-1699001000363.png

Here's the slicer I created by using this table:

vjunyantmsft_2-1699001028723.pngvjunyantmsft_3-1699001033047.png

 

First, we configure filtering for metricA , you can use the following DAX to create a new measure:

Select_metricA = 
var _avgA=
AVERAGEX(
    ALL('Table'),'Table'[metricA])
return
SWITCH(
    TRUE(),
    MAX('Table 1'[METRIC])="metricA",
IF(
    MAX('Table'[metricA]) < _avgA,1,0)
)

Click on the test data table you created earlier, drag the new measure you just created into the Filters on this visual in Filters:

vjunyantmsft_4-1699001116408.pngvjunyantmsft_5-1699001123573.png

vjunyantmsft_7-1699001169277.png

After you click the ‘Apply filter’, then choose the ‘metricA’ in the silcer, the final output is shown in the following figure:

vjunyantmsft_8-1699001210650.png

All those whose metricA is less than the average of metricA are shown up.
Steps are the same for filtering metricB, but before you filter B, don't forget to make the criteria for filtering A clear!

vjunyantmsft_11-1699001535172.png

MetricB's DAX is as follows:

Select_metricB = 
var _avgB=
AVERAGEX(
    ALL('Table'),'Table'[metricB])
return
SWITCH(
    TRUE(),
    MAX('Table 1'[METRIC])="metricB",
IF(
    MAX('Table'[metricB]) < _avgB,1,0)
)

The final output of metricB is shown in the following figure:

vjunyantmsft_10-1699001307751.png

That's the solution for you. Finally, if I misunderstand what you mean, please forgive me and provide the test data and expected results, and I will continue to try to find a workaround for you.

Best Regards,

Dino Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

 

 

 

 

 

Exactly what I was looking for ! Thank you so much for the incredibly detailed explination! 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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