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
tlipkin
Frequent Visitor

Hide or data mask row labels for all but one person

I have a matrix visual for a list of employees.  I want to be able to send a copy of the report showing everybody's data but only the individual recipient's line would have their name and the rest would either be blank or have an anonymous name reference.  I already have an anonymous name for each of the employees but I don't know how to make it so that only the individual's name is displayed and the anonymous name for everybody else.  I tried to create a formula with hasonevalue and switch and tie it to a slicer for my unrelated name table like I did to switch between measures but it doesn't work in a column.  Thanks for any help you can provide.

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

@tlipkin  When you say 'send' are you sharing the Power BI report on PowerBI.com with the employees logged in? If so, you can use Row Level Security and the USERNAME() function, but will still need to use MEASURE (not column) if you want it to respond to slicer selection. 

 

You could put the Anonoymous Name in a table visual in Power BI, and then create a measure for Employee Name: 

MEASURE:

Employee Name = IF( SELECTEDVALUE(UnrelatedName[Employee] ) = SELECTEDVALUE(Employee[EmployeeName]) , Employee[EmployeeName], Employee[AnonName] )

 

And use that measure in the table visual along with Employee ID or an index column to make sure you get one line per employee.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

7 REPLIES 7
tlipkin
Frequent Visitor

@AllisonKennedy  Reposting the response with reference to AllisonKennedy.  Sorry I forgot the first time.

 

Sorry for leaving out that level of detail.  The individual users are not connecting to the report.  The manager is running the report with all of their employees listed and then doing a screenshot to send to each individual employee.  So, they need to be able to mask everybody's name but the employee they are sending the screenshot to.

@tlipkin no need to be sorry. Have you tried the measure I suggested? Can you please share the outcome and let us know where you're stuck?


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Hi @tlipkin ,

 

Try to use data masking or set RLS for a specific user:

https://radacad.com/show-the-information-but-not-the-details-power-bi-data-masking 

https://radacad.com/dynamic-row-level-security-with-profiles-and-users-in-power-bi 


Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

AllisonKennedy
Super User
Super User

@tlipkin  When you say 'send' are you sharing the Power BI report on PowerBI.com with the employees logged in? If so, you can use Row Level Security and the USERNAME() function, but will still need to use MEASURE (not column) if you want it to respond to slicer selection. 

 

You could put the Anonoymous Name in a table visual in Power BI, and then create a measure for Employee Name: 

MEASURE:

Employee Name = IF( SELECTEDVALUE(UnrelatedName[Employee] ) = SELECTEDVALUE(Employee[EmployeeName]) , Employee[EmployeeName], Employee[AnonName] )

 

And use that measure in the table visual along with Employee ID or an index column to make sure you get one line per employee.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

I have a very similar use case to the OP.  I want to "mask" the name of all users but a selected one in both a scatter plan and a matrix chart.  I tried the formula above for the Measure.  For the Matrix chart, I was able to put the Measure in the "Values", but not the rows or columns.  This isn't ideal, but I can work around it by moving that value column to the first row and changing my Column headings to 0 width.  However, it doesn't work at all for the Scatter Plot.  I had the employee names in the "Values" section of the scatter plat.  I am unable to put this measure (or any measures) in the Values section of the scatter plot.

@AllisonKennedy  Thank you. I was finally able to reconnect with this report and this worked like a charm!!!!

Sorry for leaving out that level of detail.  The individual users are not connecting to the report.  The manager is running the report with all of their employees listed and then doing a screenshot to send to each individual employee.  So, they need to be able to mask everybody's name but the employee they are sending the screenshot to.

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.