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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
nogarr
Frequent Visitor

Dax measure - Broaden filter to include all the values within a peer group

Hi there!

 

I have survey data for which each response is connected to an employee list which contains for each respondent its assigned manager, and hierarchical level and other data.

 

In my report, I have defined a dashboard grouping the information by manager (capturing the responses of all employees which have that specific manager) using a slicer.

 

I am able to define measures to calculate the average response by manager and slice that information further. However, my problem is that I am not able to define a metric to according to the manager defined in the slicer, calculates the average response for all the managers at his hierarchical level (and slice that average after further).

 

The two tables following show of how the data is structured (they are connected by the Employee ID):

 

Employee IDManager IDHierarchy level
163
263
353
453
572
672
7na1

 

Employee IDQuestion 1Question 2Question 3
1172
2264
3240
4437
5326
6112
7531

 

For this example I would have already calculated a metric that gives me the average across questions by manager (Manager average), but not the Hierarchy level average, whose values for this example can be seen in the following table:

 

Manager IDManager AverageHierarchy level average
53.33.5
63.73.5
72.52.5

 

Any help would be welcome!

 

Thank you very much.

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @nogarr 

You need to create a measure that clears all Employee filters (using ALL or ALLSELECTED) except retains the values of Hierarchy level as a filter. Something like this worked for me in a test model:

Hierarchy level average = 
CALCULATE (
    [Manager Average],
    ALLSELECTED ( Employee ), // Could be ALL depending on requirements
    VALUES ( Employee[Hierarchy level] )
)

Here is a PBIX for reference.

I unpivoted the Survey results table, but that doesn't directly affect the above measure.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

2 REPLIES 2
OwenAuger
Super User
Super User

Hi @nogarr 

You need to create a measure that clears all Employee filters (using ALL or ALLSELECTED) except retains the values of Hierarchy level as a filter. Something like this worked for me in a test model:

Hierarchy level average = 
CALCULATE (
    [Manager Average],
    ALLSELECTED ( Employee ), // Could be ALL depending on requirements
    VALUES ( Employee[Hierarchy level] )
)

Here is a PBIX for reference.

I unpivoted the Survey results table, but that doesn't directly affect the above measure.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Hi @OwenAuger, thank you very much. At the end it was enough with using the same formula you did but with the hierarchy level that came by default in my tables, I just did not know about the "Values" formula.

 

Overall, your answer has helped me in three ways: by giving me a solution to my dashboard, by showcasing the use of the value formula and by showcasing the use of the path / pathlength formula. Thank you!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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