Forum Discussion
adoster
4 years agoResolver I
Create new Column: values based on column header (year) from another table
Hello, I'm trying to create a new column with values from another table, based on an ID & the column header which is a date/year value. Tables are linked via "Code" Table A Name Code D...
- 4 years ago
Create a calculated column...
Value = SWITCH(TRUE(),FORMAT('Table A'[Date], "yyyy") = "2019", LOOKUPVALUE('Table B'[2019], 'Table B'[Code], 'Table A'[Code]),FORMAT('Table A'[Date], "yyyy") = "2020", LOOKUPVALUE('Table B'[2020], 'Table B'[Code], 'Table A'[Code]),FORMAT('Table A'[Date], "yyyy") = "2021", LOOKUPVALUE('Table B'[2021], 'Table B'[Code], 'Table A'[Code]))Hope it will work for you.
ddpl
4 years agoSolution Sage
Create a calculated column...
Value = SWITCH(TRUE(),
FORMAT('Table A'[Date], "yyyy") = "2019", LOOKUPVALUE('Table B'[2019], 'Table B'[Code], 'Table A'[Code]),
FORMAT('Table A'[Date], "yyyy") = "2020", LOOKUPVALUE('Table B'[2020], 'Table B'[Code], 'Table A'[Code]),
FORMAT('Table A'[Date], "yyyy") = "2021", LOOKUPVALUE('Table B'[2021], 'Table B'[Code], 'Table A'[Code])
)
Hope it will work for you.
adoster
4 years agoResolver I
This works great! THANK YOU!