Power BI
Needs VotesProvide username function in Power Query - M or DAX calculated columns
Being restricted to just using username () in measures (or AllowedRowsExpression) means that you cannot use the context of the current user in slicers or page level or report level filters.
Just to be clear, the desired result is not data security (that can be done through roles), it is to provide relevance. We want to be able to show a page that shows (for example) My Teams timesheet hours, perhaps next to a report page that shows an overview of the entire company.
You can provide some neat filtering using measures containing username () , but in particular, you can’t provide slicers (or page filters) that are cut down to just the list of relevant items based on the user logged in.
It would be extremely helpful if you could access the username value either via a function in PowerQuery M, or to allow username () to be referenced in a calculated column using DAX.
Trying to use username () in a calculated column currently gives the error:
"CUSTOMDATA and USERNAME functions are not supported in calculated columns. These functions may only be used in Measures or in the AllowedRowsExpression."
Perhaps there are security, functional or performance reasons why this isn't possible, but thought it worth putting forward.
- Comments (40)
RE: Provide username function in Power Query - M or DAX calculated columns
i could also use an update on this feature, would be very usefull
RE: Provide username function in Power Query - M or DAX calculated columns
to use direct query and composite models effectively I need this feature to pass the user to the database
RE: Provide username function in Power Query - M or DAX calculated columns
I urgently need this too!!! What is the status on this feature!
RE: Provide username function in Power Query - M or DAX calculated columns
Would be useful, otherwise I have to pass in this value as a parameter
RE: Provide username function in Power Query - M or DAX calculated columns
This idea should have way more votes and attention!
RE: Provide username function in Power Query - M or DAX calculated columns
Have there been any updates on this idea? As other have mentioned below, this is something that is severely needed on my end to get some good filters going. For example: allowing a manager to filter for their direct reports vs their entire organization. Using RLS allows me to give them access to their entire org, but I need to provide away for them to specifically filter for their direct reports.
RE: Provide username function in Power Query - M or DAX calculated columns
Brian is spot on. This restricts the ability to have different types of users seeing different views. As he says, it's possible with measures but slicers use only columns. Passing the username () in Embedded and presenting back a tailored dashboard to the user would be wonderful.
And it'll take Power BI to a new level of flexibility and development potential.
RE: Provide username function in Power Query - M or DAX calculated columns
The ability to use the username in the column is critical for me as well. I need the ability to filter one visual to the current user, I can't use RLS because I am not trying to restrict the data but filter a visual.
RE: Provide username function in Power Query - M or DAX calculated columns
Team, we are stuck on username () , we cannot use it in Report level or Page level until it is in calculated columns, especially Power BI reporting Server. if the functionality is not available within a month we are forced to move our reports to other reporting tools. Hope for a new update soon....
RE: Provide username function in Power Query - M or DAX calculated columns
Team, any updates for using current username in calculated column. This is a critical functionality in implementing Row level security dynamically.