Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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