Forum Discussion
Pikachu-Power
Impactful Individual
4 years agoCALCULATE with running filter
hi all, I have a measure like CALCULATE ( Measure, Table2[Category] = "A" ) + CALCULATE ( Measure, Table2[Category] = "B" ) + CALCULATE ( Measure, Table2[Category] = "C" ) + CALCULATE ( Me...
- 4 years ago
Yes, you could do it like
Combined measure = VAR summaryTable = ADDCOLUMNS ( CALCULATETABLE ( VALUES ( 'Table2'[Category] ), KEEPFILTERS('Table2'[Category] IN { "A", "B", "C" }) ), "@val", [Base Measure] ) RETURN SUMX ( summaryTable, [@val] )
Pikachu-Power
Impactful Individual
4 years agoThank you it worked 👍
The measure dont react to a slicer with A, B and C. Is it also possible to write it in such way that I can also filter it to A, B and C?
johnt75
Super User
4 years agoYes, you could do it like
Combined measure =
VAR summaryTable =
ADDCOLUMNS (
CALCULATETABLE (
VALUES ( 'Table2'[Category] ),
KEEPFILTERS('Table2'[Category] IN { "A", "B", "C" })
),
"@val", [Base Measure]
)
RETURN
SUMX ( summaryTable, [@val] )