Forum Discussion

gazzo1967's avatar
gazzo1967
Icon for Helper III rankHelper III
3 years ago
Solved

RLS - Help needed to a newbie

HI all
I need some help/direction with RLS.

I would like to create a role.

I need users (who are managers) from my User Information list who login in to do the following:-

 

If their [Jobtitle] = Watch Commander A Sheldon with [office]=Sheldon Fire Station - Blue

or

[Jobtitle] = Crew Commander Sheldon with [office]=Sheldon Fire Station - Blue

 

to be able to view all rows users with [office] = Sheldon Fire Station - Blue only

And the same report to only show

If their [Jobtitle] = Watch Commander A Hay Mills with [office]=Hay Mills Fire Station - White

or

[Jobtitle] = Crew Commander Hay Mills with [office]=Hay Mills Fire Station - White

 

to be able to view all rows users with [office] = Hay Mills Fire Station - White only

 

I,m new to DAX so any help would be appreciated


Data sample
Title             Jobtitle            Office          Department

 

TitleJobtitleOfficeDepartment
Micky MouseWatch Commander A SheldonSheldon Fire Station - BlueBinley Fire Station
Michael LandonWatch Commander B Hay MillsHay Mills Fire Station - WhiteHay Mills Fire Station
Harold LLoydFirefighter SheldonSheldon Fire Station - BlueSheldon Fire Station
John WayneFirefighter SheldonSheldon Fire Station - BlueSheldon Fire Station
Edward Von HousenFirefighter SheldonSheldon Fire Station - BlueSheldon Fire Station
Gary CooperFirefighter SheldonSheldon Fire Station - BlueSheldon Fire Station
Steven CarlellFirefighter Hay MillsHay Mills Fire Station - WhiteHay Mills Fire Station
Matthew PerryFirefighter Hay MillsHay Mills Fire Station - WhiteHay Mills Fire Station
Paul PotterCrew Commander SheldonSheldon Fire Station - BlueSheldon Fire Station
Vikki PattersonFirefighter Hay MillsHay Mills Fire Station - WhiteHay Mills Fire Station


I then have another List with associate data.

I have already made the relationships with my other data and that all works fine.

Regards Gary

  • gazzo1967 So why not just:

    [Office] = "Sheldon Fire Station - Blue"

     

    Then just add the watch commander and crew commanders only to that role.

5 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    gazzo1967 Create an RLS role for "Sheldon Fire Station - Blue" and use this expression for the table you show:

    ([Jobtitle] = "Watch Commander A Sheldon" ||  [Jobtitle] = "Crew Commander Sheldon") && [office]="Sheldon Fire Station - Blue"
    • gazzo1967's avatar
      gazzo1967
      Icon for Helper III rankHelper III

      Greg_Deckler 
      Thank you for replying 🙂
      I did that and all it shows me is the two job titles but i need those two roles to be able to see the jobtitle Firefighter Sheldon too.

      Basically if the Watch Commander or the Crew Commander login they should be able to see everyone who has the 'office' Sheldon Fire Station - Blue
      But doing this only shows those 2 roles.
      Sorry if i am coming across a little slow 😞
      Gary

      • gazzo1967's avatar
        gazzo1967
        Icon for Helper III rankHelper III

        Greg_Deckler 
        Sorry will try explain a little more clearly.
        If the user logs in and has the [Jobtitle] of either Watch Commander A Sheldon or Crew Commander Sheldon then they need to see all rows with the [Office] = Sheldon Fire Station - Blue.
        Can this be done with an IF statement?