Forum Discussion
Sum a column if another contains partial text
- Anonymous9 years ago
If I understand your formula correctly you would put it after the <>0 before the parentheses, then put (I assume) a second FIND() condition there. Something like
FIIK = CALCULATE( SUM('WorkBookBP'[Net Inv Amt]), FILTER( 'WorkBookBP', FIND( "P1-123456789", 'WorkBookBP'[Quote Header.Quote Number], , 0 ) <> 0 || FIND( "Q2-123456789", 'WorkBookBP'[Quote Header.Quote Number], , 0 ) <> 0 ) )
Other than the alphabetic prefixes, are the numbers after the hyphen a fixed length? Of, for that matter, is it always divided into "something-number"? You could use either the LEFT or RIGHT functions depending on the structure of the number.
I got this to work for one of the quote numbers, but now I need to add 4 other quote numbers:
FIIK = CALCULATE(SUM('WorkBookBP'[Net Inv Amt]),FILTER(''WorkBookBP',FIND("P1-123456789",'WorkBookBP'[Quote Header.Quote Number],,0)<>0))
That gave me several lines of results which is perfect. Now I can't get an OR to work, I've tried || after the last two parenthesis, I've tried leaving out the ",,0)<>0)) between the II.
How do I write OR?
- Anonymous9 years agoNot applicable
If I understand your formula correctly you would put it after the <>0 before the parentheses, then put (I assume) a second FIND() condition there. Something like
FIIK = CALCULATE( SUM('WorkBookBP'[Net Inv Amt]), FILTER( 'WorkBookBP', FIND( "P1-123456789", 'WorkBookBP'[Quote Header.Quote Number], , 0 ) <> 0 || FIND( "Q2-123456789", 'WorkBookBP'[Quote Header.Quote Number], , 0 ) <> 0 ) )- Anonymous9 years agoNot applicable
That worked!! Thank you so much!!!