Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
DJLight890
Helper II
Helper II

Help with equivalent PowerBI ISNA and VLOOKUP Function

Hello,

Apologies as I’m still new to PowerBI. In PowerBI I have 2 tables that are connected via 1-to-many:

 

  • UserLookup – contains simple user data for our application such as their name, start date, etc.
  • TimesheetData – contains weekly timesheet data for each user that submits their hours worked in our application.

I am trying to take all users in the UserLookup table and essentially do a VLOOKUP formula to find the user’s timesheet approval status from the TimesheetData table. The TimesheetData table would only show ‘Approved’ and ‘Pending’ status, and for any user that does not show up in that table, I want it to say ‘Missing’.


Here is the Excel formula I would use:
=IF(ISNA(VLOOKUP(A2,Time,4,0)),"MISSING",VLOOKUP(A2,Time,4,0))


Is there something I can use in PowerBI that could provide me with similar results? I have been trying to use the LOOKUPVALUE function in PowerBI, but I keep getting errors or everyone ends up showing ‘Missing”.

 

1 ACCEPTED SOLUTION

@DJLight890 add the following measure, change column, and table name as per your model.

 

Measure = 
VAR __status = CALCULATE ( LASTNONBLANK ( Timesheet[Status], 1 ) )
RETURN IF ( __status == BLANK(), "Missing", __status ) 
 

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

5 REPLIES 5
parry2k
Super User
Super User

@DJLight890 there are many ways to do this, quick question, do these tables have a relationship? if yes, is it one to many, means, one records in the user table and many records for the same user in a timesheet, or it is one to one, means the only record in the user table and one record for the same user in the timesheet?

 

Solution will be dependent on this relationship.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hey, thank you for the reply. The relationship between the two tables are in fact one-to-many

@DJLight890 add the following measure, change column, and table name as per your model.

 

Measure = 
VAR __status = CALCULATE ( LASTNONBLANK ( Timesheet[Status], 1 ) )
RETURN IF ( __status == BLANK(), "Missing", __status ) 
 

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

WOW! Thank you so much! I kept messing around with LOOKUPVALUE, RELATED, etc. and just could not get it to work right. I truly appreciate your help! 

 

Do you have a basic source where I can learn more about measures, DAX functions, etc.? I hadn't really seen VAR or even _status used before. 

 

Thanks again and I will make sure to mark your reply as the solution!

@DJLight890 I usually do very custom training in a batch of 5 which is mainly designed around basics of DAX and then talk about actual business problems. Send me an email directly if you are interested, I give discounts with batch of 3/5/10 and I usually prefer max 5 people in a session. Thanks!

 

My email is in my signature.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.