This can be done using the ISUSERNAME() function. You could create a filter that looks something like this:
or (isusername('user1') and [branch] = 'branch1')
or (isusername('user2') and [branch] = 'branch2')
which will return true only for the conditions you describe. This assumes that the value of user1 is the same as that users server login name. If the full name is needed instead you could user the ISFULLNAME() function instead of ISUSERNAME().
There are two approaches to row level security with Tableau:
Check this article :
also you can do another solution by making 3 different views each one is filtered on Branch(x), and from the View permession you provide access to the right user.
can this be automated
Actually there are 78 branches
and there are several group of users each has specific permission to specific branches
I won't do this manually
yes, in the provided link you will find two options : Manual and Automatic User Filter method, I believe this will solve your problem.