Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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
TNGA@JJ.comJL@JJ.comUN@JJ.comJK@JJ.comDC@JJ.com
WQGA@JJ.comJL@JJ.comUN@JJ.comJK@JJ.comDC@JJ.com
DSGA@JJ.comJL@JJ.comUN@JJ.comJK@JJ.comGR@JJ.com
DAGA@JJ.comJL@JJ.comUN@JJ.comJK@JJ.comr@g.com
DCGA@JJ.comJL@JJ.comUN@JJ.comJK@JJ.comDC@JJ.com
VNGA@JJ.comJL@JJ.comUN@JJ.comJK@JJ.comVN@JJ.com
TMGA@JJ.comJL@JJ.comUN@JJ.comJK@JJ.comDC@JJ.com
JKGA@JJ.comJL@JJ.comUN@JJ.comJK@JJ.comJK@JJ.com
JK2JK@JJ.comJK@JJ.comJK@JJ.comJK@JJ.comJK@JJ.com
LPGA@JJ.comJL@JJ.comUN@JJ.comJK@JJ.comLP@JJ.com
RAGA@JJ.comJL@JJ.comUN@JJ.comJK@JJ.comDC@JJ.com
KVGA@JJ.comJL@JJ.comUN@JJ.comJK@JJ.comKV@JJ.com
1 ACCEPTED SOLUTION
mwegener
Most Valuable Professional
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. 😉

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


View solution in original post

1 REPLY 1
mwegener
Most Valuable Professional
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. 😉

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.