Forum Discussion

ashmitp869's avatar
ashmitp869
Responsive Resident
1 year ago
Solved

filter from a sharepoint folder - power query

Hi,

 

How can filter from a sharepoint folder with file name 

Course439.csv

Course196.csv

Course111.csv

Courseany3digit.csv

 


Thanks

 

  • HI,

    use the following filter 

     

     

     

    = Table.SelectRows(#"Changed Type", each  
        Text.StartsWith([Name], "Course") and  
        Text.EndsWith([Name], ".csv") and  
        Text.Length([Name]) >= 8 and  
        List.Contains({"0".."9"}, Text.Middle([Name], 6, 1)))

     

     

    Before Filter

     

     

    after filter

     

     

     

7 Replies

  • HI,

    use the following filter 

     

     

     

    = Table.SelectRows(#"Changed Type", each  
        Text.StartsWith([Name], "Course") and  
        Text.EndsWith([Name], ".csv") and  
        Text.Length([Name]) >= 8 and  
        List.Contains({"0".."9"}, Text.Middle([Name], 6, 1)))

     

     

    Before Filter

     

     

    after filter

     

     

     

    • v-dineshya's avatar
      v-dineshya
      Community Support

      Hi ashmitp869 ,

      Thank you for reaching out to the Microsoft Community Forum.

       

      If kushanNa , response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found this response helpful.

      Thank you

       

      • v-dineshya's avatar
        v-dineshya
        Community Support

        Hi @ashmitp869 ,

        Thank you for reaching out to the Microsoft Community Forum.

         

        If @kushanNa , response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found this response helpful.

        Thank you

    • ashmitp869's avatar
      ashmitp869
      Responsive Resident

      No its not fixed.

       

      Is can be CourseXXX.csv
      XXX can be any three digit (random)

  • ashmitp869 click the filter (down arrow) and use text filter -> begins wtih

     

     

    k on the filter and then use start withs

    • ashmitp869's avatar
      ashmitp869
      Responsive Resident

      That's not possible as I have a file name CourseList which I don't want to pick