Forum Discussion
Banistas
5 years agoHelper I
Create measure excluding current selection
Hi, I want to create a measure that will make a calculation excluding the current selection from it. Easier to explain with a simple example, so here I go. Let's assume I have the follow...
- Anonymous5 years ago
Hello @Banistas
Something along these lines using the EXCEPT function should work, assuming you have a [Number of Pets] measure:
Number of Pets Excluding You = CALCULATE ( [Number of Pets], EXCEPT ( ALL ( YourTable[Persons] ), VALUES ( YourTable[Persons] ) ) )Using ALL ( YourTable[Persons] ) ensures that you always get the total of all people other than filtered people. You can consider ALLSELECTED if there is an external filter on the people you want to use instead of everyone in the dataset.
Best regards
Owen
amitchandak
5 years agoSuper User
Banistas , Create a measure like this and try
calculate(sum(Table[Number of Pets]), all(Table))- sum(Table[Number of Pets])
Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.