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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
GA1993
Helper II
Helper II

Filter those items that contains certain text

Need some help.

 

I would like to create another table that gets its data from another table by applying some filters. One that I am trying to create a DAX formula for is... not including the line items that a certain field contains.

 

For example,

Filter (source table[PO Number] <> that contains "SB")

 

This is what I think of but I am not sure where to add it into my code below. Even so, changing it to the correct DAX formula.

 

 

Sales Order Tracking = 
DISTINCT(
    SELECTCOLUMNS(
        FILTER('source table,
                source table[Order reason] = "SO" 
        ),
            "Sales Order",'source table'[Order]
    )
)

 

Your help would be really appreciated!

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @GA1993 

 

You are close. Try this code:

Sales Order Tracking = 
DISTINCT (
    SELECTCOLUMNS (
        FILTER (
            'Table',
            'Table'[Plant] <> "1037"
                && 'Table'[Order reason] <> "SIM"
                && 'Table'[Order reason] <> "RTF"
                && FIND ( "SB", 'Table'[PO Number],, 0 ) = 0
        ),
        "Sales Order", 'Table'[Order]
    )
)

21091006.jpg

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

4 REPLIES 4
v-jingzhang
Community Support
Community Support

Hi @GA1993 

 

You are close. Try this code:

Sales Order Tracking = 
DISTINCT (
    SELECTCOLUMNS (
        FILTER (
            'Table',
            'Table'[Plant] <> "1037"
                && 'Table'[Order reason] <> "SIM"
                && 'Table'[Order reason] <> "RTF"
                && FIND ( "SB", 'Table'[PO Number],, 0 ) = 0
        ),
        "Sales Order", 'Table'[Order]
    )
)

21091006.jpg

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

I needed to change the <> to = to make it work, regardless thank you for the tip!

Greg_Deckler
Community Champion
Community Champion

@GA1993 I think:

Sales Order Tracking = 
DISTINCT(
    SELECTCOLUMNS(
        FILTER('source table,
                FIND("SO",source table[Order reason],,0) <> 0 
        ),
            "Sales Order",'source table'[Order]
    )
)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi thanks for replying. As for your code, I think it did the opposite. I would like to filter out those values that contain "SB" in the PO No. field.

 

I tried using your code but this is what I got.

 

GA1993_0-1631074958288.png

 

Also, is there a way to add other filters aside from the "FIND" function? Below is my code but I cant seem to make it work.

 

 

Sales Order Tracking = 
DISTINCT(
    SELECTCOLUMNS(
        FILTER('Z_CONS_03',
                Z_CONS_03[Plant] <> "1037"
                && Z_CONS_03[Order reason] <> "SIM"
                && Z_CONS_03[Order reason] <> "RTF"
),

                FIND("SB", Z_CONS_03[PO Number],,0) <> 0 
        ),
            "Sales Order",'Z_CONS_03'[Order]
)

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.