Forum Discussion
navafolk
5 years agoHelper IV
Merging column to current table column (without adding new column)
Hi pros, I have 2 tables like - 'Current' table: NAME CUR TYPE a usd on b eur off c jap on - 'New' table: NAME a d e How could I merge data from 'New...
- 5 years ago
Hi navafolk ,
Create a calculated table using below expression:
Table = var _tab=CALCULATETABLE(VALUES('Current'[NAME]),FILTER('Current','Current'[NAME]<>BLANK())) Return ADDCOLUMNS(UNION(_tab,EXCEPT(VALUES('New'[NAME]),VALUES('Current'[NAME]))),"CUR",CALCULATE(MAX('Current'[CUR]),FILTER('Current','Current'[NAME]=EARLIER('Current'[NAME]))),"TYPE",CALCULATE(MAX('Current'[TYPE]),FILTER('Current','Current'[NAME]=EARLIER('Current'[NAME]))))And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
amitchandak
5 years agoSuper User
navafolk , Append in power query
refer for steps: https://radacad.com/append-vs-merge-in-power-bi-and-power-query
navafolk
5 years agoHelper IV
Thank you amitchandak, sorry for my unclear, but I am seeking this within DAX.
- amitchandak5 years agoSuper User
navafolk , a new table like
Union(Table1, selectcolumns(Table2, Table2[Name], "CUR", "", "TYPE", "")
or
Union(Table1, selectcolumns(Table2, Table2[Name], "CUR", blank() , "TYPE", blank())
Also refer: https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/
- navafolk5 years agoHelper IV
It is just awesome. I stuck at creating null column in DAX. Big thanks.