Search code examples
excelpowerquerym

Getting relative path in Power Query using M-language


We all know the famous Excel formula to evaluate the current workpath:

=LEFT(CELL("filename");SEARCH("[";CELL("filename");1)-1)

My question is, is there any way to get the same result as the formula above (get the current path that the file/Excel is) but using only M-language or other workarounds?

Clarify that my question is merely curiosity, rather looking for a practical answer for a problem -the Excel formula works just fine for that!-.


Solution

  • There is no direct way to do this in Power Query. You could try putting the path in a cell in Excel and getting it that way though.