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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Aish33454
Regular Visitor

How to Show average Values in Matrix when collapsed

Hi All,

 

I have created a matrix where i have 4 levels. Category, sub category, task and sub task. Now i want when i collapse at task level, all sub task child values average should be shown in task level and so on till top level. The value i am showing is Pass% which i am calculting in different measure which is Pass% measure.
i managed to created DAX which is giving correct average values till sub category level but category level the average shown is not correct. Can someone please help. I am stuck.

DAX i used: 
Average Values =
IF(
ISINSCOPE('Data Sheet'[Task]),
[Pass % Measure],
AVERAGEX(
VALUES('Data Sheet'[Task]),
[Pass % Measure]
)
)

Aish33454_0-1745391204456.png

 

 

 

1 ACCEPTED SOLUTION
mdaatifraza5556
Super User
Super User

Hi @Aish33454 

Can you please try the below DAX ?

Average Values =
SWITCH(
TRUE(),
ISINSCOPE('Data Sheet'[Sub Task]), [Pass % Measure],
ISINSCOPE('Data Sheet'[Task]),
AVERAGEX(
VALUES('Data Sheet'[Sub Task]),
[Pass % Measure]
),
ISINSCOPE('Data Sheet'[Sub Category]),
AVERAGEX(
VALUES('Data Sheet'[Task]),
CALCULATE(
AVERAGEX(
VALUES('Data Sheet'[Sub Task]),
[Pass % Measure]
)
)
),
ISINSCOPE('Data Sheet'[Category]),
AVERAGEX(
VALUES('Data Sheet'[Sub Category]),
CALCULATE(
AVERAGEX(
VALUES('Data Sheet'[Task]),
CALCULATE(
AVERAGEX(
VALUES('Data Sheet'[Sub Task]),
[Pass % Measure]
)
)
)
)
)
)

If this answers your questions, kindly accept it as solution and give kudos.

View solution in original post

4 REPLIES 4
Aish33454
Regular Visitor

This is great. Thank you so much.
But this measure is not working when i am trying to use in Paypal KPI donut chart. Is there a way to make this work in other visuals as well?

Hi @Aish33454 

For donut chart can you please try this.

Average Values =
AVERAGEX(
VALUES('Data Sheet'[Sub Task]),
[Pass % Measure]
)


If this answers your questions, kindly accept it as a solution and give kudo.

I want at category level, to display the same average va;ue which is in my matrix at top most level. 
I tried this measure and others but its giving some different values. I dont exactly know how power bi is calculting the values.

mdaatifraza5556
Super User
Super User

Hi @Aish33454 

Can you please try the below DAX ?

Average Values =
SWITCH(
TRUE(),
ISINSCOPE('Data Sheet'[Sub Task]), [Pass % Measure],
ISINSCOPE('Data Sheet'[Task]),
AVERAGEX(
VALUES('Data Sheet'[Sub Task]),
[Pass % Measure]
),
ISINSCOPE('Data Sheet'[Sub Category]),
AVERAGEX(
VALUES('Data Sheet'[Task]),
CALCULATE(
AVERAGEX(
VALUES('Data Sheet'[Sub Task]),
[Pass % Measure]
)
)
),
ISINSCOPE('Data Sheet'[Category]),
AVERAGEX(
VALUES('Data Sheet'[Sub Category]),
CALCULATE(
AVERAGEX(
VALUES('Data Sheet'[Task]),
CALCULATE(
AVERAGEX(
VALUES('Data Sheet'[Sub Task]),
[Pass % Measure]
)
)
)
)
)
)

If this answers your questions, kindly accept it as solution and give kudos.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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