cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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

Accepted Solutions
Highlighted
Super User VII
Super User VII

Re: Help with equivalent PowerBI ISNA and VLOOKUP Function

@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.






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
Highlighted
Super User VII
Super User VII

Re: Help with equivalent PowerBI ISNA and VLOOKUP Function

@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.






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.





Highlighted
Helper I
Helper I

Re: Help with equivalent PowerBI ISNA and VLOOKUP Function

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

Highlighted
Super User VII
Super User VII

Re: Help with equivalent PowerBI ISNA and VLOOKUP Function

@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.






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

Highlighted
Helper I
Helper I

Re: Help with equivalent PowerBI ISNA and VLOOKUP Function

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!

Highlighted
Super User VII
Super User VII

Re: Help with equivalent PowerBI ISNA and VLOOKUP Function

@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.






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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors