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
dadelta
Frequent Visitor

use wildcard characters in query editor

I am importing pdf files from a folder.  Everything went well with the first file but when

Part of my editing (in the query editor) is to filter column1 to remove several values.  When I added a second file to the folder this filter stopped working and the row is not filtering out of the dataset.

 

Here is the M code that is generating:

= Table.SelectRows(#"Changed Type", each ([Column1] <> null and [Column1] <> 12/4/2018 and [Column1] <> "All"))

 

Here is an example of the data importing.

Source.NameColumn1Column2Column3
Nov 18 Reasonableness Check.pdf12/4/2018FIPSOct 19
Nov 18 Reasonableness Check.pdfStatewide 1161132
Nov 18 Reasonableness Check.pdfcounty name131789

 

Each month the "12/4/2018" in Column1 will be a different date in a datatype text.

What I need to do is replace the "12/4/2018" in the code with some type of wildcard that will recognize the style (xx/xx/xxxx) and filter out that row no matter what date is listed.  I do not need any of the fields in that row.

I've tried to replace the 12/4/2018 with ?/?/? with no luck.  I've also tried the % sign and * sign in place of the question mark.

 

This is how I would like the file to look with additional files added.  The numbers in Column2 & Column3 are importing correctly.  I just can't seem to get the one row to filter out.

Source.NameColumn1Column2Column3
Nov 18 Reasonableness Check.pdfStatewide 1161132
Nov 18 Reasonableness Check.pdfcounty name131789
Oct 18 Reasonableness Check.pdfStatewide 1201123
Oct 18 Reasonableness Check.pdfcounty name132555

Any help is greatly appreciated.  Thank you.

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@dadelta

 

What if you make this change in red font below

 

 

 

 

 

= Table.SelectRows(#"Changed Type", each ([Column1] <> null 
and Text.Contains([Column1],"/")=false and [Column1] <> "All"))

 


Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@dadelta

 

What if you make this change in red font below

 

 

 

 

 

= Table.SelectRows(#"Changed Type", each ([Column1] <> null 
and Text.Contains([Column1],"/")=false and [Column1] <> "All"))

 


Regards
Zubair

Please try my custom visuals

This worked perfectly for this project and another file I've been trying to import.  Thank you so much.

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.