Forum Discussion
sjoshi
Helper II
7 years agoIF, 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 ...
Greg_Deckler
Community Champion
7 years agoCould be a number of things. If you [AccountNum] is numeric, then comparing it to text won't work, you would need to remove the quotes. Are you getting an error?
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
sjoshi
Helper II
7 years agoHi Greg
I'm not getting any error. Accountnum is text column
Thanks
Smita
- Greg_Deckler7 years ago
Community Champion
OK, so is the formula presented a measure or a column?
Sample data would be really helpful as well. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Although, I'm thinking:
52500 = IF('LedgerTrans Fact'[AccountNum]="14850", CALCULATE ( SUM ( 'LedgerTrans Fact'[AmountMST] ), FILTER (ALL( 'LedgerTrans Fact'), 'LedgerTrans Fact'[AccountNum] = "52500" ) ),0)