Option to Use PBI Credentials for UserName()/UserPrincipalName()
Power BI Desktop computes the values to use DAX functions UserName() and UserPrincipalName() based on the local computer's currently logged in user, not the user logged in to Desktop.
It would be really neat if Power BI Desktop offered the option (perhaps a checkbox under settings) for UserName() and UserPrincipalName() to be populated based on account used to log into Power BI Desktop. After all, if I’m logged in to Desktop under a certain account, I’m probably going to be uploading to Service under that account, and so it’s quite likely that any RLS testing (or other use of UserName()/UserPrincipalName()) I’d want to do would be relative to that account.
Randy Coates commented
In fact, expand this idea to allow a USERPRINCIPALNAME() value to be entered during the "view as role" functionality that is already provided, with a default of current user. As a developer, especially with imported data, I can see all data, so there is no security risk. Maybe other connection types such as Live or Power BI dataset with RLS would need to block this ability.