The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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]
)
)
Solved! Go to Solution.
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.
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.
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.
User | Count |
---|---|
77 | |
75 | |
36 | |
31 | |
29 |
User | Count |
---|---|
94 | |
80 | |
55 | |
48 | |
48 |