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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bouyazbekj
Helper I
Helper I

Excluding certain items from a column

Hello everyone,

 

I have a column of item codes and I would like to only see certain ones. 

 

For example I want to only see items that start with an E and B from this column 

 

E0617-0012
E0666-0012
B0605-0052
A0325-0065
C0266-0065
E0069-0005
C0058-0085
B0688-9985
G2215-0085

 

Thank you 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @bouyazbekj,

 

You can enter to query editor and apply a filter with following custom filter expression:

#"Filtered Rows" = Table.SelectRows(#"Changed Type", each Text.StartsWith([Text],"E") or Text.StartsWith([Text],"B"))

1.png

 

Full query:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("RcxRCoAwDAPQu+zbQVZp7T5Vxg4xdv9rWGuHf3kkZIzUIOXIQKE0N6fIzwsCNvLHEzu9FHbeIB8Hm6VqxGrBalReV6q51mAnKhztfAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Text = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Text", type text}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each Text.StartsWith([Text],"E") or Text.StartsWith([Text],"B"))
in
    #"Filtered Rows"

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

HI @bouyazbekj,

 

You can enter to query editor and apply a filter with following custom filter expression:

#"Filtered Rows" = Table.SelectRows(#"Changed Type", each Text.StartsWith([Text],"E") or Text.StartsWith([Text],"B"))

1.png

 

Full query:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("RcxRCoAwDAPQu+zbQVZp7T5Vxg4xdv9rWGuHf3kkZIzUIOXIQKE0N6fIzwsCNvLHEzu9FHbeIB8Hm6VqxGrBalReV6q51mAnKhztfAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Text = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Text", type text}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each Text.StartsWith([Text],"E") or Text.StartsWith([Text],"B"))
in
    #"Filtered Rows"

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.