Forum Discussion
CCConsulting
1 year agoRegular Visitor
Add column in (one) table with max value from another table (many)
Would greatly appreicate help with this. I want to add a column to Table 1 that inserts the maximum value of "Invoice #" from that Account/Customer's multipe rows in Table 2. Next I want to populate...
- 1 year ago
Hi CCConsulting
Can you please follow the below steps and use the dax to get your requirement ?Since Invoice # is in text format, I am assuming the values are sequential alphabetically.
1. Create a calculated column on table1.Most Recent Invoice # =CALCULATE(MAX('Table2'[Invoice #]),FILTER('Table2','Table2'[Customer Number] = 'Table1'[Account Number]))
2. Create final calculated column in table1.
New Charges from Most Recent Invoice =LOOKUPVALUE('Table2'[New Charges],'Table2'[Customer Number], 'Table1'[Account Number],'Table2'[Invoice #], 'Table1'[Most Recent Invoice #])If this answers your questions, kindly accept it as a solution and give kudos.
mdaatifraza5556
Super User
1 year agoHi CCConsulting
Can you please follow the below steps and use the dax to get your requirement ?
Since Invoice # is in text format, I am assuming the values are sequential alphabetically.
1. Create a calculated column on table1.
Most Recent Invoice # =
CALCULATE(
MAX('Table2'[Invoice #]),
FILTER(
'Table2',
'Table2'[Customer Number] = 'Table1'[Account Number]
)
)
2. Create final calculated column in table1.
2. Create final calculated column in table1.
New Charges from Most Recent Invoice =
LOOKUPVALUE(
'Table2'[New Charges],
'Table2'[Customer Number], 'Table1'[Account Number],
'Table2'[Invoice #], 'Table1'[Most Recent Invoice #]
)