0

I want to write a Query which would give the Sum of the value where the string contains 'SP11' without any break

For Example in the below table I want to add the value of the 3rd, 6th and 7th rows

String          | Value
________________|_______
A/B/SP1/ADDS    | 12
ss/B/SP2/A      |  2
A/C/D/SP11/C    | 66
Ass/C/ASD       | 46
ACD/SP1/C/V/C   | 45
F/D/SP11/C      | 85
F/D/SP11/C/12/D | 21

Which would result in something like SP11 = 172 which was derived by adding up the values of

Value of 3rd row(A/C/D/SP11/C)+ Value of 6th row(F/D/SP11/C)+Value of 7th row(F/D/SP11/C/12/D)

= 66+85+21=172 This is the Query I tried to get the value required but this doesn't work

CALCULATE(Sum(Query1[Value]), FIND("*SP11*",Query1[Value])>0)

2 Answers2

0

The correct measure is this :

Measure:=CALCULATE(sum([value]),filter(Table1,FIND("SP11",Table1[string],1,0)>0))
0

try this:

CALCULATE(SUM(TABLE[VALUE]), SEARCH("SP11",Table[String],1,0)>0)
jcy
  • 1
  • 1
  • 8