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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Default values with lookup function

I have two table 1. Dynamic(will update realtime) 2) static reference file  and used lookupvalue function to retrive value of one column from static rerence file to dynamic(new column). But, is there any option i can use as default value incase there is no matching.  Also i need to derive default value of new column in dynamic table  using existing coloumn of dynamic column.

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to your description,I created 2 sample tables as below:

Annotation 2020-08-24 105628.pngAnnotation 2020-08-24 105650.png

Then create a calculated column as below:

Column = LOOKUPVALUE(Table1[Value],'Table1'[Category],'Table2'[Category],Table2[Value])

And you will see:

Annotation 2020-08-24 105754.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

5 REPLIES 5
v-kelly-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to your description,I created 2 sample tables as below:

Annotation 2020-08-24 105628.pngAnnotation 2020-08-24 105650.png

Then create a calculated column as below:

Column = LOOKUPVALUE(Table1[Value],'Table1'[Category],'Table2'[Category],Table2[Value])

And you will see:

Annotation 2020-08-24 105754.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Fowmy
Super User
Super User

@Anonymous 

The LOOKUPVALUE function has the last paramter for the alternative result

[Region] = LOOKUPVALUE(Employee[Region], Employee[Email], USERNAME(), BLANK())

https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Greg_Deckler
Super User
Super User

@Anonymous - Yes, the last parameter of LOOKUPVALUE is the alternate result to be used if more than one value is found or no values are found:

 

https://docs.microsoft.com/en-us/dax/lookupvalue-function-dax

 

 



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks for reply. but my requirement bit different here

Some ex

Table-a col-1 col-2 Table-b col-1 ,col-3

currently I used table-a(col2) = lookupvalues(table-b(col3), table-b(col-1),table-a(col-1)) whis return value if table-a[col1] = table-b(col1), if not match i need pouplate table-a(col-2) = table-a(col-1). Hope its clear

Hi,

Do any of these work?

=lookupvalues(table-b(col3), table-b(col-1),table-a(col-1),table-a(col-1))

or

=if(isblank(lookupvalues(table-b(col3), table-b(col-1),table-a(col-1))),table-a(col-1),lookupvalues(table-b(col3), table-b(col-1),table-a(col-1)))

Hope this helps.

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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