Forum Discussion
sjoshi
7 years agoHelper II
IF, FILTER SUM Function
Hello, I'm trying to do one simple thing but not sure why filter is not working If accountnum ="14850" the take sum of amount for accountnum "52500" else null. This statement I have tried to ...
sjoshi
7 years agoHelper II
Hello
I have written below measure by removing the if statement then its giving me total sum
select sum(amountmst) from ledgertrans_fact where ledgertrans.accountnum='52500' its not applying other time and project slicers and retruning same value in each row.
52500 = CALCULATE (
SUM ( 'LedgerTrans Fact'[AmountMST] ),
FILTER ( ALL('LedgerTrans Fact'), 'LedgerTrans Fact'[AccountNum] = "52500"))
If I take below mesure then its giving probelm in IF condition.
52500 = IF('LedgerTrans Fact'[AccountNum]="14850",
CALCULATE (
SUM ( 'LedgerTrans Fact'[AmountMST] ),
FILTER (ALL( 'LedgerTrans Fact'), 'LedgerTrans Fact'[AccountNum] = "52500" )
),0)
sjoshi
7 years agoHelper II
Also when I add 52500 measure in values then all other working columns such amountmst, prior quarter etc are not working fine.