Forum Discussion
Iterate through a measure
- 3 years ago
PowerBITestingG I would think:
Wanted measure = VAR __Table = SUMMARIZE(ALLSELECTED('Table'),[Country],[Condition],"Quantity",[Quantity]) RETURN SUMX(FILTER(__Table,[Condition] = 1),[Quantity])
PowerBITestingG ALLSELECTED just removes the direct filters within the visual, so in this case Country and Condition, for example. It preserves all of the other filters coming from visual selections in other visuals. You can use ALLSELECTED on it's own, wrapped in a FILTER or SUMMARIZE or any other function that expects a table of values as a parameter. No, it is not resticted for sole use in CALCULATE but a lot of people seem to believe that is the case.
"For the sake of simplicity, we shorten that complex article into this best practice: never use ALLSELECTED inside an iteration."
- Greg_Deckler3 years ago
Community Champion
PowerBITestingG You could say the same thing about CALCULATE in general. People say similar stuff about SUMMARIZE but it's like this 1 extremely specific situation where you might get some craziness. I don't worry about edge cases that you aren't going to run into in any conceivable situation.