Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
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
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 8 | |
| 7 | |
| 7 |