Forum Discussion
Pass username as filter or parameter in query using DirectQuery to SQL?
Hi guys. Actually, this is possible in theory. If I can use RLS and have a table with the value you want to pass to SQL, linked to USERPRINCIPALNAME() or USERNAME(), whichever you want to use, then it should be possible. Create/Upload a table to PBI with the data as a created table or via a query
Create a measure where the USERPRINCIPALNAME() matches a value in the table using LOOKUPVALUE() and assign the resulting value to a parameter in your SQL query.
I have not tried this, but I have tried some things to display a user friendly name on the currently loaded Visual/Repoort/Dashboard.
So yes, I am quite sure it is possible.
If anyone actually gets this to work, I will gladly like to know. If I have time I will give it a try myself. The query will have to be edited manually to get it to work. It will only load data for a matching value.
If I understand what you are asking, then this may be a solution.