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.
Hello,
Apologies as I’m still new to PowerBI. In PowerBI I have 2 tables that are connected via 1-to-many:
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”.
Solved! Go to 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.
@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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
76 | |
74 | |
49 |
User | Count |
---|---|
146 | |
108 | |
106 | |
90 | |
62 |