Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Change the Chart X Axis column Based on RLS value

Hi All,

I am very new to Power BI and looking for your help here !

I have applied RLS to my dashboard using USERPRINCIPALNAME ()

There are 5 columns that I am using in the RLS to search for USERPRINCIPALNAME (). This works fine for me as I am using OR function to apply the RLS. Below mentioned is the function used in RLS.

 

[ManagerEmail2] = USERPRINCIPALNAME()||[ManagerEmail3] = USERPRINCIPALNAME()||[ManagerEmail4] = USERPRINCIPALNAME()||[ManagerEmail5] = USERPRINCIPALNAME()||[ManagerEmail6] = USERPRINCIPALNAME()

 

The issue I am facing is with the dynamically change the chart X axis based on the RLS result column. For example if the logged in user email ID is found in Column "[ManagerEmail5]" then I want to change the chart X axis to [ManagerEmail6]. Is this possible in Power BI ? Below is the sample data from my Table.

 

If I have to do this in SQL server, I can use IF statement in a custom column to change the respective Column values to display. If (USERPRINCIPALNAME () in [ManagerEmail2] , [ManagerEmail3], If (USERPRINCIPALNAME () in [ManagerEmail3] , [ManagerEmail4], If (USERPRINCIPALNAME () in [ManagerEmail5] , [ManagerEmail6], Blank())

 

emp_full_nameManagerEmail2ManagerEmail3ManagerEmail4ManagerEmail5ManagerEmail6
TN[email protected][email protected][email protected][email protected][email protected]
WQ[email protected][email protected][email protected][email protected][email protected]
DS[email protected][email protected][email protected][email protected][email protected]
DA[email protected][email protected][email protected][email protected][email protected]
DC[email protected][email protected][email protected][email protected][email protected]
VN[email protected][email protected][email protected][email protected][email protected]
TM[email protected][email protected][email protected][email protected][email protected]
JK[email protected][email protected][email protected][email protected][email protected]
JK2[email protected][email protected][email protected][email protected][email protected]
LP[email protected][email protected][email protected][email protected][email protected]
RA[email protected][email protected][email protected][email protected][email protected]
KV[email protected][email protected][email protected][email protected][email protected]
  • Hi Anonymous ,

     

    check this out.

    PBIX

    I had to knock the data flat and use a m:n relationship, but it should work. ğŸ˜‰

     

1 Reply

  • mwegener's avatar
    mwegener
    Most Valuable Professional

    Hi Anonymous ,

     

    check this out.

    PBIX

    I had to knock the data flat and use a m:n relationship, but it should work. ğŸ˜‰