Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have a user_mappings table which lists various different pieces of infomation about users of a system, such as AD loginname, email, userprinciplename (from ad), their manager, and if they are a manager themselves (1 for yes 0 for no).
What I am trying to do is within a measure workout if the user viewing the report is marked as a manager in the usermappings table if so show them a figure, and if not stay blank.
The idea being that a non-manager would see all the infomation about theselves shown in the report - and a blank column for this measure, whereas a manager would see the same info AS WELL as the infomation within the column.
I have the following
Manager? =
VAR _isManager = MAXX(
FILTER(
User_Mappings,
User_Mappings[ActiveDirectory.user.mail]=USERNAME()
)
,User_Mappings[IsManager_num]
)
RETURN IF(_isManager = 1, MAX('TABLENAME'[Booking]), BLANK())
I have created 3 temporary measures and thrown them on cards to verify that when I view the report as a known manager, I get the logged in user's email and UserPrinciplename correctly by the
Solved! Go to Solution.
Hi @SACooper ,
My test table:
User_Mapping:
Product:
Mode:
Try below measure:
Procuet_Fruit =
VAR cur_email =
SELECTEDVALUE ( User_Mapping[Email] )
VAR cur_isManager =
SELECTEDVALUE ( User_Mapping[IsManager_num] )
VAR cur_upn =
USERPRINCIPALNAME ()
RETURN
IF (
cur_email = cur_upn
&& cur_isManager = 1,
CALCULATE (
MAX ( 'Product'[Fruit] ),
FILTER ( 'Product', 'Product'[Email] = cur_email )
),
BLANK ()
)
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @SACooper ,
My test table:
User_Mapping:
Product:
Mode:
Try below measure:
Procuet_Fruit =
VAR cur_email =
SELECTEDVALUE ( User_Mapping[Email] )
VAR cur_isManager =
SELECTEDVALUE ( User_Mapping[IsManager_num] )
VAR cur_upn =
USERPRINCIPALNAME ()
RETURN
IF (
cur_email = cur_upn
&& cur_isManager = 1,
CALCULATE (
MAX ( 'Product'[Fruit] ),
FILTER ( 'Product', 'Product'[Email] = cur_email )
),
BLANK ()
)
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is brilliant thank you - think got myself working down the wrong route here but with a little tweak, this worked!
Hi,
My question is how large this organization is and how other managers change. If this is a manageable size is would make two Row-Level-Security roles that filter on different aspects of the windows AD. The nice part of this is that if a user is a manager and become a non-manager he/she would see nothing anymore as a safequard of GDPR (Europe).
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 |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |