Forum Discussion
Jayaselvan
Helper II
4 years agoFilter with text contains with AND Logic
Hello All, I have a input file shown as below. There are two filters brand, region Output1: Output 2: File Link: https://docs.google.com/spreadsheets/d/16MQRA2GiufoQ7q...
- 4 years ago
Hi Jayaselvan
Please refer to attached sample file with the solutionFiltered Value = VAR SelectdBrands = VALUES ( Brands[Brand] ) RETURN SUMX ( VALUES ( 'Table'[brand] ), VAR CurrentBrands = 'Table'[brand] VAR String1 = SUBSTITUTE ( CurrentBrands, "[", "" ) VAR String2 = SUBSTITUTE ( String1, "]", "" ) VAR String3 = SUBSTITUTE ( String2, "“", "" ) VAR String4 = SUBSTITUTE ( String3, "”", "" ) VAR String5 = SUBSTITUTE ( String4, " ", "" ) VAR Items = SUBSTITUTE ( String5, ",", "|" ) VAR Length = COALESCE ( PATHLENGTH ( Items ), 1 ) VAR T1 = GENERATESERIES ( 1, Length, 1 ) VAR T2 = ADDCOLUMNS ( T1, "@Brand", PATHITEM ( Items, [Value] ) ) VAR T3 = SELECTCOLUMNS ( T2, "@@Brand", [@Brand] ) VAR T4 = INTERSECT ( T3, SelectdBrands ) RETURN IF ( COUNTROWS ( SelectdBrands ) = COUNTROWS ( T4 ), CALCULATE ( SUM ( 'Table'[value] ) ) ) )
onurbmiguel_
Power Participant
4 years agoHi again,
Try this link
https://drive.google.com/file/d/19_ps__mKX0CZIteXBZnXRQ46p-sDCBBc/view?usp=sharing
BR
Bruno
Jayaselvan
Helper II
4 years agoHello
Thank you, I can access the link now.
It satisfies Sample Output 1.
But the output 2(Selecting multiple brands) is not achieved here. We have to select the rows which contains all the selected value.
Your Output:
The expected Output