This sounds like a great use-case to Restrict Data Access with User Filters and Row Level Security. I'd look in particular at this section: Create a dynamic filter using a security field in the data. The basic idea is to have a table in your data source where you map each username to its department. With that, you can create a filter based on the username logged in Tableau Server, so that only data mapped to it shows up on a view or dashboard.
The process is also shown towards the end of this video: Data Security with User Filters
Hope this helps!
Different things you can do.
User filters might do it for you.
Or you can create a calc that gathers (this data) for one user (or group) and gathers (that data) for another user (or group.)
We have ISMEMBEROF() function that lets you do things based on what group a user is in. We also have ISUSERNAME() that lets you identify a specific username.
Actually, something I do is pop filters and sheets in/out based on ISMEMBEROF(). On some dashboards we have special stuff for a group we call "Power user". If the user is a power user, they get extra filters and parameters that allow them to play with the data deeper. Regular users only see the data under default values of those filters/parameters. Also we display extra stuff, and I pop out extra sheets for the power users.
And in one case only the power users are allowed to see a certain dashboard at all. If the user is not a power user and somehow gets to that dashboard, a giant sheet pops out to cover the whole thing. All they see is a message that says, "You do not have access to this dashboard. Click here to go back to the main menu." And a SELECT action on that sheet sends them back.
For you, if you can use ISMEMBEROF in a filter to limit the data, that's a good way to go. Otherwise you can make separate sheets for the different groups and use ISMEMBEROF to swap the right sheet into place and swap out the one they shouldn't see.
You are so right,Santiago Sanchez. thanks so much.
After quite some time researching the net and after I have posted this thread, I came across that link and I thought I would give it a try. Thanks for letting me know that this could really be it as I was just thinking about this yesterday. Also, thanks for that link to a video. That I didn't know about. I will also watch that and will let you know if I am able to do what I need.
Thanks so much. I just love this community and the people who is always willing to spend time to help others.
Have a great day ahead,