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.
First of all, this is not about row level security.
Say we have sales rep and their sales data
SalesRep table:
SalesRepId, SalesRepName, MaskedSalesRepName, SalesRepEmail
1, 'Joe Smith', 'Sales Rep A', 'joesmith@gmail.com'
2, 'John Wick', 'Sales Rep B', 'Johnwick@hotmail.com'
Sales table: SalesId, SalesRepId, product, price etc
Final output (in table and bar chart)
MaskedSalesRepName, No of sales
Sales Rep A, 12
Sales Rep B, 5
The requirement here is to mask the Sales Rep Name in the report - which is easy to do. However, there is a problem for this approach.
If the sales rep A login (as joesmith@gmail.com), he sees a report like this, he would not know which sales no is his own as the name is masked. Ideally he sees
MaskedSalesRepName, No of sales
Joe Smith, 12
Sales Rep B, 5
So while he see everyone else No of sales without knowing their names, he also sees his own sales number.
Hope this makes sense.
Thanks in advance.
Solved! Go to Solution.
@Anonymous ,
refer to this link
https://radacad.com/show-the-information-but-not-the-details-power-bi-data-masking
You might need a measure like this
Masked Measure =
if( max(Table[SalesRepEmail]) =USERPRINCIPALNAME() = ,max(Table[SalesRepName]),"Other"))
Masked Measure =
IF( max(Table[SalesRepEmail]) =USERPRINCIPALNAME() = ,max(Table[SalesRepName]),max(Table[MaskedName]))
@Anonymous ,
refer to this link
https://radacad.com/show-the-information-but-not-the-details-power-bi-data-masking
You might need a measure like this
Masked Measure =
if( max(Table[SalesRepEmail]) =USERPRINCIPALNAME() = ,max(Table[SalesRepName]),"Other"))
Masked Measure =
IF( max(Table[SalesRepEmail]) =USERPRINCIPALNAME() = ,max(Table[SalesRepName]),max(Table[MaskedName]))
thanks for the quick reply. It was very helpful. Actually I have read that link before asking the question. I got stuck by trying to use the new measure as the AXIS - which is not possible. I now realised I can use masked Sales Rep name as the AXIS. In order to know which is the current user, all I need is to the set the visual filter to "current user is not blank" (current user is the new measure created in the link)
@Anonymous - Well, you could potentially user USERPRINCIPALNAME like:
MaskedSalesRepName Measure =
IF(USERPRINCIPALNAME() = MAX([SalesRepEmail]),MAX([SalesRepName]),MAX([MaskedSalesRepName]))
Might work.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |