Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 15 | |
| 8 | |
| 8 | |
| 8 |