Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Dynamic Row Level Security Equation not working with Date Filter

I have created a hierarchy row level security role in power bi desktop which works as long as there is not date filter on the report. I am trying to create a human resources report that will show the number of resources we have in the company and show their managers who are their direct reports. The HR department wants to see this on a monthly basis and wants to send it out to managers but only allow them to see their hierarchy in the company. The equation works, but not when I have the date filter. I have some test data and the equation below. Any help with this would be greatly appreciated.

IDNameDateEmailManagerIDUserIDMgrID
1Mary1/1/2019[email protected] 143466143466
2Matthew1/1/2019[email protected] 243466243466
3David1/1/2019[email protected]1343466143466
4Mark1/1/2019[email protected]2443466243466
5Amy1/1/2019[email protected]1543466143466
6Bill1/1/2019[email protected]4643466443466
7Justin1/1/2019[email protected]2743466243466
8Lindsay1/1/2019[email protected]5843466543466
1Mary2/1/2019[email protected] 143497143497
2Matthew2/1/2019[email protected] 243497243497
3David2/1/2019[email protected]1343497143497
4Mark2/1/2019[email protected]2443497243497
5Amy2/1/2019[email protected]1543497143497
6Bill2/1/2019[email protected]4643497443497
7Justin2/1/2019[email protected]3743497343497
8Lindsay2/1/2019[email protected]5843497543497
1Mary3/1/2019[email protected] 143525143525
2Matthew3/1/2019[email protected] 243525243525
3David3/1/2019[email protected]1343525143525
4Mark3/1/2019[email protected]2443525243525
5Amy3/1/2019[email protected]1543525143525
6Bill3/1/2019[email protected]4643525443525
7Justin3/1/2019[email protected]3743525343525
8Lindsay3/1/2019[email protected]7843525743525

 

The equation I am using:

PATHCONTAINS(Sheet1[Path],
MaxX(
Filter(
Sheet1,
[Email]=USERPRINCIPALNAME()
)
,Sheet1[UserID]
)
)

1 Reply

  • Cmcmahan's avatar
    Cmcmahan
    Resident Rockstar

    I'm assuming [Path] is a measure or calculated column you've created to give you a path string of the hierarchy?  Could you share that expression with us?

    As it stands, I'm curious: does it work when the date filter is set to the most recent date?