Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello
I have a report that uses RLS, so the person running the report sees the data they are allowed to view according to RLS rules, and the value of their email retreived from the userprincipalname() function. This works great.
In the report I have another barchart that shows data for all users (including the user who is logged in). I would like it to be conditionally formatted so that the bar relating to the logged-in user (i.e. the unique ID linked to the email value taken from the userprincipalname()) is highlighted in a different colour compared to all the other bars, so that the user/reader of the report can easily see where they are in the chart compared to all the others.
For example, this yellow-ringed bar belongs to the currently logged-in user (the userprincipalname() holds the user's email address they are logged-in with). Can we have conditional formatting to display that bar in different colours compared to the other users' bars?
Can this be done?
I have a table that holds only the value of the current logged-in user's ID but when I try to use the field from this table in a measure (to be used to conditionally format the appropriate bar in the chart) I get the message that there are many user ID values in the table, and not just the one ID that I see in when running the report as the user.
If I use a card to display a measure that gets the ID from the above-mentioned table displays the correct user ID and only that unique ID.
Can this highlighting the current user / logged-in user in a chart (even for example the point relating to the logged-in user in a scatter diagram) be done?
Thanks in advance.
Solved! Go to Solution.
Hello!
Thank you for you help.
The issue is that I do not have the email address in the fact table that the graph reads from.
Instead it is in a table (B) linked to the Fact table (A) by user ID (1 "BehID" in table B to many "Behandlare ID" in table A):
I created the following measure on the fact table and used it in the conditional formatting on the Fact table's columns, but it doesn't change the colour of the column relating to the currently logged-in user to pink.
Hi, @miken72
You can create a measure as follows.
Measure = SWITCH(TRUE(),
SELECTEDVALUE('Table (2)'[name]) = USERPRINCIPALNAME() , "pink",
SELECTEDVALUE('Table (2)'[name]) <> USERPRINCIPALNAME(), "blue"
)
Then select the button as shown.
Then add the conditions as shown.
Is this the result you expect?
Best Regards,
Yuliax
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello!
Thank you for you help.
The issue is that I do not have the email address in the fact table that the graph reads from.
Instead it is in a table (B) linked to the Fact table (A) by user ID (1 "BehID" in table B to many "Behandlare ID" in table A):
I created the following measure on the fact table and used it in the conditional formatting on the Fact table's columns, but it doesn't change the colour of the column relating to the currently logged-in user to pink.
Hello again.
I solved it by adding the email address to the Fact table, having the measure check that field, and then hiding the email address column in the table.
It works now - thanks again, great stuff!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
77 | |
74 | |
57 | |
38 | |
33 |
User | Count |
---|---|
70 | |
63 | |
55 | |
48 | |
46 |