Forum Discussion

miken72's avatar
miken72
Icon for Helper I rankHelper I
2 years ago
Solved

Conditional formatting - highlighting the bar in a graph that belongs to the userprincipalname()

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 userprincipaln...
  • miken72's avatar
    miken72
    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