Forum Discussion
Rename column value for some users
I have a table with data from dealerships and one column has the name. Every dealership has an account.
What I would like to do, is to hide the name of the other dealerships when one dealership logs in their account or rename it with some code or change it with an image.
So, when the dealership logs in their account, it sees a report where only their name is displayed, but all the data is still there.
I know with RLS I can filter by user but I do not know if it is possible to only change the column value.
Thank you in advance.
3 Replies
- deldersveldResident Rockstar
With or without RLS, you can still create a measure that uses either USERNAME() or USERPRINCIPALNAME() to associate the dealer login with the correct column value. If there's a table that contains records for both the dealer login and correct column value, you could use something along the lines of = LOOKUPVALUE('Table'[Column Value],'Table'[Dealer Login, USERPRINCIPALNAME())
- Sdaniels3152New Member
Thank you, I did not know the function "username()". But what I need is to change the name in the table.
For example, if "Username()" returns "Dealership x", only "Dealership x" name should be shown, the other dealership names should be hidden or replaced with a code, image...
- AnonymousNot applicable
Hi Sdaniels3152,
I don’t think that you can replace other dealerships’ names with a code, image when a specific dealership logs in his own account. However, you can hidden other dealerships’ names and their related data in this scenario, you can review the following blog about how to achieve this requirement by implementing dynamic Row Level Security.
http://radacad.com/dynamic-row-level-security-with-power-bi-made-simple
Thanks,
Lydia Zhang