Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Filtering using text found in a column

I have a table as follows. 

ClientpriceLine MemoDate
A34000Outgoing payment -A12/2/2022
b23000Failed to pay13/9/2022
c21440Incoming Payment - C1/2/2023
d53000On hold23/7/2022
e56000Outgoing payment -e4/6/2022
f12300Incoming Payment -f6/12/2022
g61000On transit12/1/2023

 

 

The plan is to do a Sum of the price where the Line memo contains Outgoing Payment or Incoming Payment prefixes and also is for the year 2022.  

this is where I am at 

though with an error.

 

Cumulative Balance =
CALCULATE (
SUM ( Table[Price] ),

    FILTER (Table, SEARCH(Table [Line Memo] ="Incoming Payments" && (Table [Line Memo] ="Outgoing Payments" )
        && Table[Date] <= "12/31/2022"
)))

 

 

Please assist. Thanks.

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Try this:

 

Try both && as shown below and also try > || instead of &&

 

SEARCH("Incoming Payments" && "Outgoing Payments", Table [Line Memo])

 

 

 

Search DAX function | Text functions in Power BI - Power BI Docs

View solution in original post

Anonymous
Not applicable

Hi @Anonymous ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_1-1675742827206.png

2. create a measure with below dax formula

Measure =
VAR tmp =
    FILTER (
        ALL ( 'Table' ),
        AND (
            OR (
                CONTAINSSTRING ( [Line Memo], "Incoming payment" ),
                CONTAINSSTRING ( [Line Memo], "Outgoing payment" )
            ),
            [Date] <= DATE ( 2022, 12, 31 )
        )
    )
RETURN
    SUMX ( tmp, [price] )

3. add a card visual with measure

vbinbinyumsft_0-1675742803924.png

 

 

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_1-1675742827206.png

2. create a measure with below dax formula

Measure =
VAR tmp =
    FILTER (
        ALL ( 'Table' ),
        AND (
            OR (
                CONTAINSSTRING ( [Line Memo], "Incoming payment" ),
                CONTAINSSTRING ( [Line Memo], "Outgoing payment" )
            ),
            [Date] <= DATE ( 2022, 12, 31 )
        )
    )
RETURN
    SUMX ( tmp, [price] )

3. add a card visual with measure

vbinbinyumsft_0-1675742803924.png

 

 

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

I appreciate the answer @Anonymous 

Anonymous
Not applicable

Try this:

 

Try both && as shown below and also try > || instead of &&

 

SEARCH("Incoming Payments" && "Outgoing Payments", Table [Line Memo])

 

 

 

Search DAX function | Text functions in Power BI - Power BI Docs

Anonymous
Not applicable

Can u show the error? Possible add a pbix.

Anonymous
Not applicable

The error is.

Too few arguments were passed to the SEARCH function. The minimum argument count for the function is 2.

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.