Forum Discussion
Anonymous
4 years agoNot 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 mon...
- 4 years ago
Give this code a go:
Value 1day 12am = LOOKUPVALUE( FirstoftheMonth[energydata_value], FirstoftheMonth[DateKey],'Main Data'[DateKey], FirstoftheMonth[devicename_id], 'Main Data'[devicename_id] )
bcdobbs
4 years agoCommunity 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).
bcdobbs
4 years agoCommunity 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]
)- Anonymous4 years agoNot applicable
This definitely does its job! Thank you so much !!!