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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Vlookup

Hi everyone, im new to power bi. Ive been trying to achieve data using vlookup but i am unable to do so. My aim is to:

-Extract value of data on the firstday of the month at 12 am. (First of the month Table) and pair with each dates on (Main Table)

Error ive gotten : A table of multiple values was supplied where a single value was expected.

Hopefully someone could help, Thank you.

sabrina_az_0-1641047680199.png

 

1 ACCEPTED SOLUTION
bcdobbs
Community Champion
Community Champion

Give this code a go:

Value 1day 12am = 
    LOOKUPVALUE(
        FirstoftheMonth[energydata_value], 
        FirstoftheMonth[DateKey],'Main Data'[DateKey], 
        FirstoftheMonth[devicename_id], 'Main Data'[devicename_id] 
    )


Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

May i know how i could send you my data, Thank you

Best way is to share a link from one drive/Google drive/drop box etc.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
bcdobbs
Community Champion
Community Champion

Hi,

 

You're getting the error because for a particular date key LOOKUPVALUE is finding more than one energy data values.

 

Are you able to share a demo file with your structure and some sample data or just some tables of dummy data for each relevant table. Normally there are better ways to achieve what you are trying  by leveraging existing relations (RELATED and RELATEDTABLE).



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
bcdobbs
Community Champion
Community Champion

Give this code a go:

Value 1day 12am = 
    LOOKUPVALUE(
        FirstoftheMonth[energydata_value], 
        FirstoftheMonth[DateKey],'Main Data'[DateKey], 
        FirstoftheMonth[devicename_id], 'Main Data'[devicename_id] 
    )


Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Anonymous
Not applicable

This definitely does its job! Thank you so much !!!

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.