Forum Discussion
Create a column based on a lookup in another table
- 7 years ago
Hi michellepace,
You could try below
Column = LOOKUPVALUE('Table2'[AccNumber],'Table2'[AccNumber],'Table 1'[AccNumber])*1000Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 6 years ago
Hi, it's amazing how I can make something so simple so complicated :). The RELATED function worked for me. Just posting this pic here for anyone else who may find it useful.
Hi,
Given that there is relationship between 2 tables, you can use RELATED function in DAX to achieve this:
Use the below code to create the column in Table 2.
Main = RELATED( Table1[AccNumber] )
Thanks.
Hi Anonymous , thank you for your reply. I've tried to follow your advice but obviously I'm getting something wrong... can anyone please tell me why I am getting this error? As far as I can see my syntax is correct...?
- dax7 years ago
Community Support
Hi michellepace,
You could try below
Column = LOOKUPVALUE('Table2'[AccNumber],'Table2'[AccNumber],'Table 1'[AccNumber])*1000Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- michellepace6 years ago
Resolver III
Hi, it's amazing how I can make something so simple so complicated :). The RELATED function worked for me. Just posting this pic here for anyone else who may find it useful.
- HelenaX5 years ago
Helper I
Thank you! So helpful!!
- Ashish_Mathur7 years ago
Super User
Hi,
That formula has to be written in the AccBalances Table and it should be a calculated column formula (not a measure)
- michellepace7 years ago
Resolver III
Hi Ashish, thanks again for your reply. What I am trying to do is get a column which is in the AccBalances Table, into my Hierarchy table. So... I'm not really sure why I would then be writing the formula in the table (AccBalances) which already has the column I need. Sorry, I am completely confused here. Can you please detail exactly what you mean?
And in fact, although I may be wrong, I found that the Lookup function only works when I am on the 'many' side of the cardinality looking up into a table on the '1 side' of the cardinality. That is, there is no ambiguity for the lookup function. This makes sense to me. Am I correct or imagining it?
- Ashish_Mathur7 years ago
Super User
Hi,
Share the link from where i can download your PBI file.