Skip to main content
Microsoft Idea

Power BI

Needs Votes

dynamic username in data sources

Vote (6) Share
Nasir Shaikh's profile image

Nasir Shaikh on 26 Apr 2018 18:57:09

Can we have a m language function to pickup username from windows to make data source dynamic. Just like Environ(username) function in VBA. This will very helpful for those who work on different systems and when report is being produced by different users

Comments (1)
Nasir Shaikh's profile image Profile Picture

Didier Terrien on 06 Jul 2020 00:09:58

RE: dynamic username in data sources

The following post describes 4 ways to get the username in Power Query :
https://querypower.com/2017/04/03/4-ways-to-get-username-in-power-query/
Unfortunately, the simplest method (n°2) is not reliable because of NTFS delay as explained in the post.
So I developped a function using the same concept with some improvements :
https://thebipower.fr/index.php/2020/03/04/get-username-function-in-power-query/
Hoping it helps