Forum Discussion

ChristopherDuncan's avatar
ChristopherDuncan
Copper Contributor
Jul 19, 2021

Power Query Relative Path for OneDrive and Other Users

Let me start by saying that I have read the posts about converting from an Absolute path to a Relative path in PowerQuery (primarily https://techcommunity.microsoft.com/t5/excel/power-query-source-fr...
  • SergeiBaklan's avatar
    SergeiBaklan
    Jul 19, 2021

    ChristopherDuncan 

    That could be like

    Source = if Text.Start(filepath,5) = "https"
             then  Web.Contents(...)
             else  Csv.Document(...),
    

    but you shall to clean filepath before (remove sheet name and brackets). You may do in sheet by formula or in Power Query by another if then else. Hope it's possible to find ready to use pattern for both.