Skip to content

Instantly share code, notes, and snippets.

@Hugoberry
Last active September 5, 2020 11:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hugoberry/5c9948a2729be7ab0a4af83356c27ce5 to your computer and use it in GitHub Desktop.
Save Hugoberry/5c9948a2729be7ab0a4af83356c27ce5 to your computer and use it in GitHub Desktop.
Power Query get current USERNAME via NTFS route
//Assumes current user is the one with latest [Date accessed] folder in C:\Users
let
Users = Folder.Contents("C:/Users"),
CurrentUser = Table.FirstN(Table.Sort(Users,{{"Date accessed", Order.Descending}}),1)[Name]{0}
in
CurrentUser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment