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
DevadathanK
Resolver I
Resolver I

Cannot create a column by searching for values in another table

Hello community!

<Message removed>

Thanks for any help!

4 REPLIES 4
Greg_Deckler
Super User
Super User

Have you tried LOOKUPVALUE?https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

I did, but i keep getting stcuk at one point.

In the latest LOOKUPVALUE used in the above code, the search column should be Employee ID, but it wont let me choose that option.

 

 

 

I managed to work around the issue that didnt let me pick EMPLOYEE ID, and managed to complete the code, but i cant seem to narrow down the Looked up value to a single value. There are multiple Leaves taken in a single week, so LOOKUPVALUE will return a table of values and not a single one.

The Error states "A table of multiple values was supplied where a single value was expected"

Is there anyother way to do this code other than LOOKUPVALUE? Or is there something that i missed to use along with LOOKUPVALUE?

I removed the multiple leaves that were coming in a single week. Now this code works. 

 

Employee IDEmployee NameLeave From Date Leave To DateFrom Week No. To Week No.Days
1001Miss. O1-Jan-201-Jan-20111
1007Mr. K2-Jan-203-Jan-20112
1009Mr. J2-Jan-2015-Jan-201310

 

But the ideal solution is to incorportate any scenario, and this code will fail in other situations.

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.