Forum Discussion
Pass username as filter or parameter in query using DirectQuery to SQL?
UserName is DAX function and I don;t think you can pass this as query parameter. You can filter the records on USERNAME() once records are loaded.
I was hoping to find a way to pass it into SQL as a parameter, I looked at using M but I didn't see any options for passing usernames that way (rather I didn't see a username function for M).
Ideally, I would be able to do a SELECT Col1, Col2, Col3 FROM Table1 WHERE Table1.Username=username()
(from PBI of course) however, I don't see anyway to pass system variables/parameters into queries.
I wanted to filter them BEFORE they are loaded, so if my table had 1 million records, I would much rather return only the records that matched UserName() instead of the entire table.
- parry2k8 years agoSuper User
Well as mentioned before, unfortunately I'm not aware of that you can pass username() value to power query, it is going to be filter after table is loaded.
- angelikamariae7 years agoHelper I
Hi
Did you find the answer for this? I have exactly the same issue.
thanks.
A.
- angelikamariae7 years agoHelper I
Hi
Did you find a solution for this problem? I have the same issue.
tks
A.