Forum Discussion
Conditional formatting - highlighting the bar in a graph that belongs to the userprincipalname()
- 2 years ago
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.HighlightUsersColumnMeasure2 = SWITCH(TRUE(),SELECTEDVALUE('EmailBehID'[Emailadress]) = USERPRINCIPALNAME() , "pink",SELECTEDVALUE('EmailBehID'[Emailadress]) <> USERPRINCIPALNAME(), "blue")
Would I need the email address field in the Fact table for this conditional formatting to work?
I'd rather not have it there, and instead display the user ID (behandlare ID).
I am right in thinking that I could have it there but hide it or is there another way to solve this without having the email address in the Fact table (table A)?
Thanks again
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.
- miken722 years ago
Helper I
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.HighlightUsersColumnMeasure2 = SWITCH(TRUE(),SELECTEDVALUE('EmailBehID'[Emailadress]) = USERPRINCIPALNAME() , "pink",SELECTEDVALUE('EmailBehID'[Emailadress]) <> USERPRINCIPALNAME(), "blue")
Would I need the email address field in the Fact table for this conditional formatting to work?
I'd rather not have it there, and instead display the user ID (behandlare ID).
I am right in thinking that I could have it there but hide it or is there another way to solve this without having the email address in the Fact table (table A)?
Thanks again- miken722 years ago
Helper I
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!