Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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).
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
45 | |
28 | |
21 | |
11 | |
8 |
User | Count |
---|---|
75 | |
51 | |
46 | |
16 | |
12 |