The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All,
Could someone please assist me in retrieving the second lookup value instead of the first one? Here are the details:
Table Name: Roles_EmailID
When the user "abcd@gmail.com" logs in, it should return the value "superuser@gmail.com", but it is currently returning "test@gmail.com".
Here is my DAX
VAR _getRoles = IF(CALCULATE (
FIRSTNONBLANK (Roles_EmailID[Email_IDS], 1 ),
FILTER ( ALL ( Roles_EmailID ), Roles_EmailID[RolesEmailid] = USERPRINCIPALNAME())) = "superuser@gmail.com" ,
TRUE(),
[RolesEmailid] = USERPRINCIPALNAME())
RETURN
_getRoles
Solved! Go to Solution.
Hi @Rathod -The rank must correctly differentiate between the different email IDs associated with each RolesEmailid.
create a measure:
Verify that the value returned by USERPRINCIPALNAME() matches exactly with the values in the RolesEmailid column.
Hope this helps
Proud to be a Super User! | |
@Rathod Try with:
if it's ok please accept my answer as solution.
BBF
Hi @Rathod -The rank must correctly differentiate between the different email IDs associated with each RolesEmailid.
create a measure:
Verify that the value returned by USERPRINCIPALNAME() matches exactly with the values in the RolesEmailid column.
Hope this helps
Proud to be a Super User! | |
Hi Rajendra,
Sorry, its working fine. thank you so much
Hi Rajendra,
Thanks for your swift response, i tried with your dax but unfortunatly getting below error
@Rathod , You can try using RANKX for this
VAR _getRoles =
CALCULATE (
FIRSTNONBLANK ( Roles_EmailID[Email_IDS], 1 ),
FILTER (
ADDCOLUMNS (
FILTER ( ALL ( Roles_EmailID ), Roles_EmailID[RolesEmailid] = USERPRINCIPALNAME() ),
"Rank", RANKX ( FILTER ( ALL ( Roles_EmailID ), Roles_EmailID[RolesEmailid] = USERPRINCIPALNAME() ), Roles_EmailID[Email_IDS], , ASC, DENSE )
),
[Rank] = 2
)
)
RETURN
_getRoles
Proud to be a Super User! |
|
Hi Gautam,
Thanks, its working fine
User | Count |
---|---|
12 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
24 | |
14 | |
13 | |
9 | |
7 |