Forum Discussion
Filter problems
- 1 year ago
Hi Anonymous ,
Try this measure:
_Measure = VAR D = [Value] -- The current value based on filters VAR AD = CALCULATE( [Value], ALLEXCEPT('FactTable', 'FactTable'[Other Columns...]) -- Preserve filters on other columns except Status ) VAR RESULT = DIVIDE(D, AD, BLANK()) -- Calculate the percentage RETURN RESULTIf the above dont work, please consider to try this one with SUMX:
_Measure = VAR D = [Value] VAR AD = SUMX( ALL('FactTable'[Status]), CALCULATE(SUM('FactTable'[Values])) ) VAR RESULT = DIVIDE(D, AD, BLANK()) RETURN RESULT
Hi Anonymous ,
Looking at your current approach, the issue likely arises because you're using the ALL function, which removes any filters on the Status column, causing the result to always be based on the total sum of values across all statuses, even when the table is filtered.
Please try this updated version of your measure:
_Measure =
VAR D = [Value] -- The sum of 'FactTable[Values]' in the current context
VAR AD =
CALCULATE (
[Value], -- The total sum of values across the entire FactTable (not just filtered by Status)
REMOVEFILTERS('FactTable'[Status]) -- This removes only the filter on the 'Status' column
)
VAR RESULT =
DIVIDE(D, AD, BLANK()) -- Dividing the current value by the total value to get the percentage
RETURN
RESULT
- Anonymous1 year agoNot applicable
Thanks all you guys for the replys, unfortunatly non of them have solve my issue.
Then thing is that this format for a % measure work fine when column i don´t want filterd are in a dim tabel and not in the fact were the value is.
So maby issue is that value and column I want to removefilter on are in the same table?- Bibiano_Geraldo1 year agoSuper User
Hi Anonymous ,
Try this measure:
_Measure = VAR D = [Value] -- The current value based on filters VAR AD = CALCULATE( [Value], ALLEXCEPT('FactTable', 'FactTable'[Other Columns...]) -- Preserve filters on other columns except Status ) VAR RESULT = DIVIDE(D, AD, BLANK()) -- Calculate the percentage RETURN RESULTIf the above dont work, please consider to try this one with SUMX:
_Measure = VAR D = [Value] VAR AD = SUMX( ALL('FactTable'[Status]), CALCULATE(SUM('FactTable'[Values])) ) VAR RESULT = DIVIDE(D, AD, BLANK()) RETURN RESULT