Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
johnwood
New Member

Filter data on USERNAME()

Hi,

I am trying to implement the concept of a "MY" dashboard on a set of timesheet data.  The only way I think this can be done is via the USERNAME() function.  So far I have:

1. retreived a unique USERNAME() (this turns out to be a long hex string)

2. converted to the actual user name (as stored in the timesheet data) using a LOOKUPVALUE() function on a table I created, using a measure called CurrentUser

3. tried to find a method to create a filter based on matchng my CurrentUser measure to the actual data field which stores the user name in my timesheet data.  This is where I got stuck, I just cannot fogure out a way of doing this!

Any help most grateully received!

John

7 REPLIES 7
LenWright
New Member

If I understand correctly from the Data summit just held in Seattle, the next release of Power BI will have row-level security, which is what you're after, I think.

Thanks!  I will keep an eye out for that.

fbrossard
Advocate V
Advocate V

The only way to filter data on UserName() is to use an Analysis Services Cube.

1. Create an SSAS cube

2. Implement the dynamic security with SSAS by using Roles based on the username() coupled to the LookupValue() DAX functions. 

3. Install and configure the Enterprise Gateways to access to your cube, the credentials of the user will be passed through the cube.

4. Create a PBIX on you cube by using Direct Connect create your report.

5. Publish to the PBI Service

6. Build your dahsboard

7. Make a Content Pack and share it to the target users

8. Each user can now use your content pack

Data will then be filter for each user according to their credentials

Many thanks fbrossard.

I'm still a way away from the kind of solution you suggest...for the time being my users will have to filter on their name on screen!

If you publish your report as an Organizational Content Pack, your users will be able to Personalize a copy, and save it with the filter applied to their name. If the report design doesn't change often, this should be pretty convenient for them.

and if I want to create a column using the following function new column : = if ( [email User ] = username (); " my dashboard ", " other " ) I would create this function to know how much " my dashboard " is . suppose I want to know how much is my sales within the company, but I can not see how my colleagues have to share.

greggyb
Resident Rockstar
Resident Rockstar

To my understanding the return value of USERNAME() in PBI Service shouldn't be used to identify individuals within an organization. I would love to hear otherwise.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.