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
Arkhos94
Helper IV
Helper IV

Sharepoint folder source / How to filter well ?

After a lot of try I manage to connect my power query to my sharepoint folder. The data I want to load is a set of excel file (one per month, named "nationales + year-month" (so "Nationale 2021-05", "Nationale 2021-04" and so on)

 

I load more file that I want, so I need to filter. But I want the filter to be efficient so I don't want to update my filter each month

 

Right now my power query look like this :

Source = SharePoint.Files("https://mycompany.sharepoint.com/sites/sharepointsitename", [ApiVersion = 15]),
#"Lignes filtrées" = Table.SelectRows(Source, each ([Name] = "Nationale 2021-01.xlsx" or [Name] = "Nationale 2021-02.xlsx" or [Name] = "Nationale 2021-03.xlsx" or [Name] = "Nationale 2021-04.xlsx" or [Name] = "Nationale 2021-05.xlsx")),

 

Is there any way to replace the "each ([Name] =" so it will select every name that start by "Nationale " ?

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

= Table.SelectRows(Source, each Text.StartsWith([Name], "Nationale"))

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

3 REPLIES 3
Arkhos94
Helper IV
Helper IV

Thank you @CNENFRNL 

 

I think it's time for me to start learning the coding language used by power query

Yes, indeed, perhaps 20% of ETL tasks can be completed by UI; the real power of Power Query lies in the M language.

Good luck!


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

CNENFRNL
Community Champion
Community Champion

= Table.SelectRows(Source, each Text.StartsWith([Name], "Nationale"))

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

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.

Top Solution Authors
Top Kudoed Authors