Forum Discussion

Doylezeebeast's avatar
Doylezeebeast
Frequent Visitor
1 year ago

Dax code for row level security to handle path function where a parent can report to a parent

Hi there,

              I have been making use of the "PATH" function in power BI to build some row level security. This is for a data set where this lists all of the supervisory organizations in a business, along with its reference ID, who the mananger is, their email address and then the reference ID number of the "superior" supervisory organization. However in some cases there can be a sceniro where by a manager can inherit the supervisory organization below them due to the supervisory organization not having a “real” manager in post. In these cases the dax for the row level security appears to break and then no visuals are displayed on the screen.

When I look at the “PATH” function in my table this works correctly and builds all the way to the top of the hierarchy. So I think it must be something to do with the Dax used for the RLS? For reference here is the code being used:

 

PATHCONTAINS(

    Data[Path],

    Maxx(

        FILTER(

            Data,

            [Email] = USERPRINCIPALNAME()

        ),

        Data[Supervisory Org reference ID]

    )

)

 

Any help would be greatly received! Thank you

3 Replies