Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
HI All,
I am new to Dax and I can't seem to figure out how to find the average of all values in the category without including the present row of another category. For example, I want to find the average of all controls of all other jurisdictions except the one on the row. See below.
Sorry, I can't explain it properly.
Control Number | Jurisdiction | Average | Average of others |
Control 1 | SA | 2 | 3.5 |
Control 1 | NSW | 3 | 3 |
Control 1 | WA | 4 | 2.5 |
Control 2 | SA | 3 | 3.5 |
Control 2 | NSW | 4 | 3 |
Control 2 | WA | 3 | 3.5 |
Control 3 | SA | 7 | 5.5 |
Control 3 | NSW | 6 | 6 |
Control 3 | WA | 5 | 6.5 |
Solved! Go to Solution.
Hi @stjimi
From your example, it looks like a measure such as this would give the result you want:
Average of others =
CALCULATE (
[Average],
EXCEPT (
ALLSELECTED ( YourTable[Jurisdiction] ),
VALUES ( YourTable[Jurisdiction] )
)
)
This assumes a measure [Average] is already defined.
The EXCEPT ( ... ) expression creates a modified filter on Jurisdiction, by taking the filter on Jurisdiction applying to the overall visual, and removing the value(s) of Jurisdiction visible in the current filter context, i.e. removes the single value from the current row of your table in your example.
Regards,
Owen
Thanks so much, Owen. This makes sense. How would I go about defining a measure for the Average? Would I do this with a 'new measure'. Sorry about the simple question.
It would just be AVERAGE ( Table1[Column1] ) where you substitute whatever column you're wanting to average instead of my placeholder.
Hi @stjimi
From your example, it looks like a measure such as this would give the result you want:
Average of others =
CALCULATE (
[Average],
EXCEPT (
ALLSELECTED ( YourTable[Jurisdiction] ),
VALUES ( YourTable[Jurisdiction] )
)
)
This assumes a measure [Average] is already defined.
The EXCEPT ( ... ) expression creates a modified filter on Jurisdiction, by taking the filter on Jurisdiction applying to the overall visual, and removing the value(s) of Jurisdiction visible in the current filter context, i.e. removes the single value from the current row of your table in your example.
Regards,
Owen
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
10 | |
10 | |
9 | |
9 |
User | Count |
---|---|
20 | |
13 | |
12 | |
11 | |
8 |