Forum Discussion
Custom data details per user and aggregation sharing
Hi Anonymous
Thank you for reaching out microsoft fabric community forum.
You're right: the first DAX-based solution works well in Power BI visuals but not in Excel-connected reports, since Excel pulls raw data. The second approach, with two columns, is better for that.
You can add two columns in your data model: one with full names (EmployeeName) and one with masked names (EmployeeNameHidden, like J***). The masked version can be created in Power Query or DAX using:
Text.Start([EmployeeName],1) & Text.Repeat("*", Text.Length([EmployeeName]) - 1)
Then create a Field Parameter with both columns. Power BI doesn't let you switch this dynamically with DAX, but you can work around it by creating two visuals (one with each column) and use a DAX measure like this to control which one to show:
IsManager = IF(USERPRINCIPALNAME() IN VALUES(Employee[ManagerEmail]), 1, 0)
Based on this, use bookmarks or visual-level filters to show the correct version depending on who is viewing. This approach also works better for Excel, since only the appropriate column is exposed in the model.
If this solution helps, please consider giving us Kudos and accepting it as the solution so that it may assist other members in the community
Thank you.