Forum Discussion
Hiding a column based on a user
Anonymousyour solution is ok but if any of the field is used in report and is not available in data model based on user column selection, report will stop working, so I personally don;t think it is advisable to not to return the columns to the model , it is better to make multiple roles based on user and remove those columns.
Let me know if I missed something.
So solution is to create calculated column and remove value from the column, it will break any report.
Thanks for this. While the formula works to put a dash, the problem is since we can't turn off underlying data they can still export the aggragate and see the salary information.
I'm so bummed out about this. :( :( :( :(
- parry2k8 years ago
Super User
Anonymous In my very first reply I mentioned you about this. You really need to create seperate report and remove this field from data model, there is no other way at this point. If there was ability to pass user name to "power query", it would have been nice. You have to mask your data at source end or remove the column from model.
- Anonymous8 years agoNot applicable
I know. I just wish underlying data could at least be turned off and not just full export.
- Anonymous8 years agoNot applicable
Hi parry2k,
I hope you are well. I tried doing this again using this formula:
Amount Hide 3 =
var r = IF(CONTAINS(Users,Users[UserName], USERNAME()), 1, 0)
return if(r = 1, Calculate(SUM('Active'[Annual Salary (USD)])), Blank())However, when I add this into my table visual, all the records show up as blank values if the user is not there, not just the one column -- strange. I only want the Annual Salary (USD) column to show up as blank values. Is there something I'm doing wrong? I don't have the users table mapped to my active table because if I do that then only one record shows.
Please and thank you!