Forum Discussion
ngocnguyen
Helper IV
4 years agoSubtotal sum
Hi, Hi I have somes measure to get result of factors: A,B,C,D,Cost Logic for :" Cost (exclude factor) = Cost - remaining factors Now I wanna create a matrix that like below { Cost ( exc...
Jihwan_Kim
Super User
4 years agoHi,
I am not sure if I understood your question correctly, but please try to write a measure something like below.
Expected measure: =
SWITCH (
SELECTEDVALUE ( 'tablename'[Factor] ),
"Cost(exclude factor)"
= CALCULATE (
SUM ( 'tablename'[Amt] ),
FILTER ( ALLSELECTED ( 'tablename' ), 'tablename'[Factor] = "Cost" )
)
- CALCULATE (
SUM ( 'tablename'[Amt] ),
FILTER ( ALLSELECTED ( 'tablename' ), 'tablename'[Factor] <> "Cost" )
), SUM ( 'tablename'[Amt] )
)
- ngocnguyen4 years ago
Helper IV
Hi Jihwan_Kim
Thanks for your help
However, My issue is that, each reasult in column "Amt" in matrix are Measure
For example:A= [A], B = [B], C =[C], Cost =[Cost]
So logic for Cost (exclude factor) = Cost - remaining factors
Then to issue the matrix I create a measure like:Amt =
SWITCH( TRUE(),SELECTEDVALUE(table[Factor])= "A",[A],SELECTEDVALUE(table[Factor])= "B",[B],
SELECTEDVALUE(table[Factor])= "C",[C],
SELECTEDVALUE(table[Factor])= "Cost",[Cost],
Blank())
So, with this measure I just can create a matrix as belowNow I wanna create a measure so that the Cost (Exclude factor ) = Cost - Factors appearing in matrix like this one: