The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
let
Source = SharePoint.Files(Web.Contents("https://[site].sharepoint.com/sites/ITLeadership"), null, true),
#"Filtered Rows" = Table.SelectRows(Source,each ([Folder Path] = "https://[site].sharepoint.com/sites/ProjectITLeadership/_layouts")),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Active Projects - 48", type text}, {"Computer Users", Int64.Type}, {"Project IT Staff", Int64.Type}, {"""AS Sold"" Project Cost", Int64.Type}, {"Project IT Budgets Current IT Spend of all Projects", Int64.Type}, {"Current IT Spend of all Projects", Int64.Type}, {"Column7", type text}, {"Column8", type any}, {"Column9", type any}, {"Column10", type text}, {"Column11", type any}}),
#"Kept First Rows" = Table.FirstN(#"Changed Type", each [#"Active Projects - 48"] <> null),
#"Removed Other Columns" = Table.SelectColumns(#"Kept First Rows",{"Active Projects - 48", "Computer Users", "Project IT Staff", """AS Sold"" Project Cost", "Project IT Budgets Current IT Spend of all Projects", "Current IT Spend of all Projects"})
in
#"Removed Other Columns"
Is the file path wrong? I have an excel sheet uploaded into sharepoint and from sharepoint I open the excel sheet but usually when i inport the data to power bi i have to look for the specific excel sheet.
Expression.Error: 3 arguments were passed to function which expects between 1 and 2.
Details:
Pattern=
Arguments=List
i got this errror
Yes, there is a problem with the Source-step. Use this instead:
Source = SharePoint.Files(Web.Contents("https://[site].sharepoint.com/sites/ITLeadership"))
or: Source = SharePoint.Files(Web.Contents("https://[site].sharepoint.com/sites/ITLeadership"), 15)
see: https://docs.microsoft.com/en-us/powerquery-m/sharepoint-files
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries