cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Resident Rockstar
Resident Rockstar

Re: Filter data on USERNAME()

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.

Highlighted
Advocate V
Advocate V

Re: Filter data on USERNAME()

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

Highlighted
New Member

Re: Filter data on USERNAME()

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!

Highlighted
Resident Rockstar
Resident Rockstar

Re: Filter data on USERNAME()

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.

Highlighted
New Member

Re: Filter data on USERNAME()

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.

Highlighted
New Member

Re: Filter data on USERNAME()

Thanks!  I will keep an eye out for that.

Highlighted
Regular Visitor

Re: Filter data on USERNAME()

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.

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors