Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I want to create a measure that shows the impacts of a category column (the change in the overall score measure when the specific category is removed)
I want to create a table like this:
Category | Score | Impact | Count |
a | 30 | -10 | 30 |
b | 40 | -8 | 45 |
c | 45 | 3 | 51 |
d | 50 | 4 | 10 |
Total | 40 | 0 | 136 |
The impact column in this example is not correct just for example.
I tried to create this with the following fields:
Total Score = AVERAGE('Table'[Score])
Solved! Go to Solution.
Hi @trevordunham ,
Thanks for the reply from @Greg_Deckler , please allow me to provide another insight:
The argument to the ALL function must be either a reference to a base table or a reference to a base column. You cannot use table expressions or column expressions with the ALL function.
Refer to:
ALL function (DAX) - DAX | Microsoft Learn
You can using the following measure:
Impact of Category =
var _select=SELECTEDVALUE('Table'[Category])
return
CALCULATE(
AVERAGE('Table'[Score]),FILTER(ALL('Table'),'Table'[Category]<>_select))
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @trevordunham ,
Thanks for the reply from @Greg_Deckler , please allow me to provide another insight:
The argument to the ALL function must be either a reference to a base table or a reference to a base column. You cannot use table expressions or column expressions with the ALL function.
Refer to:
ALL function (DAX) - DAX | Microsoft Learn
You can using the following measure:
Impact of Category =
var _select=SELECTEDVALUE('Table'[Category])
return
CALCULATE(
AVERAGE('Table'[Score]),FILTER(ALL('Table'),'Table'[Category]<>_select))
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Perhaps:
Impact of Category =
VAR __Category = MAX('Table'[Category]
VAR __Table = FILTER( ALL( 'Table' ), [Category] <> __Category )
VAR __Result = AVERAGEX( __Table, [Score] )
RETURN
__Result
@trevordunham Well, I would think that you would want the overall average which would be:
Total Score = AVERAGEX(ALL('Table'), [Score])
You may also be running into a measure totals issue. First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e
This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
104 | |
77 | |
67 | |
63 |
User | Count |
---|---|
144 | |
107 | |
105 | |
82 | |
69 |