Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi, I've spent the last hour trying to understand this and google around. I must be missing something completely because it simply cannot be that difficult. Alright, I have the below two tables:
___________________
Table 1:
AccNumber |
Table 2:
AccNumber | AccDescrip
___________________
All I want to do is create an additional calculated column called "Main" in Table 1. Where for each row, the equivalent vlookup function would be:
Main = vlookup( Table1.AccNumber * 1000, Table2, 2, False)
Could anyone please shed some light as to what my formula would be for creating a calculated column?
Solved! Go to Solution.
Hi michellepace,
You could try below
Column = LOOKUPVALUE('Table2'[AccNumber],'Table2'[AccNumber],'Table 1'[AccNumber])*1000
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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...?
Hi michellepace,
You could try below
Column = LOOKUPVALUE('Table2'[AccNumber],'Table2'[AccNumber],'Table 1'[AccNumber])*1000
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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.
Thank you! So helpful!!
Hi,
That formula has to be written in the AccBalances Table and it should be a calculated column formula (not a measure)
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?
Hi,
Share the link from where i can download your PBI file.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
102 | |
84 | |
79 | |
70 |
User | Count |
---|---|
120 | |
110 | |
95 | |
82 | |
77 |