This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowThe Fabric community is upgrading! Read all of the details including the timeline and what you can expect. Learn more
Hi,
I am trying to create new table using existing tables as shown in the example below
| TABLE_A | TABLE_B | TABLE_C | TABLE_D |
| 1-A | 1-B | 1-C | 1-D |
| 2-A | 2-B | 2-C | 2-D |
| 3-A | 3-B | 3-C | 3-D |
| 4-A | 4-B | 4-C | 4-D |
| RESULT_TABLE | |
| 1-A | 1-C |
| 2-A | 2-C |
| 3-A | 3-C |
| 4-A | 4-C |
| 1-B | 1-D |
| 2-B | 2-D |
| 3-B | 3-D |
| 4-B | 4-D |
Can someone please help me with the DAX for the same.
Thank you🙂
Hi @Anonymous ,
"TABLE_A", "TABLE_B" are column names, right? If so, try this:
New Table =
VAR t1 =
SELECTCOLUMNS ( 'Table', "Column 1", [TABLE_A], "Column 2", [TABLE_C] )
VAR t2 =
SELECTCOLUMNS ( 'Table', "Column 1", [TABLE_B], "Column 2", [TABLE_D] )
RETURN
UNION ( t1, t2 )
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , Create a copy of this table in power Query.
In the existing table drop column table_B , Table_D
and new Table table drop column table_A , Table_C
append these two tables
Duplicate table -https://radacad.com/reference-vs-duplicate-in-power-bi-power-query-back-to-basics
Append : https://radacad.com/append-vs-merge-in-power-bi-and-power-query
@amitchandak Thank you for your respond.
but actual tables are containing rows in millions hence processing time with this method is more than accpetable.
Is it possible to do it with DAX in one step or faster?
Thanks
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
| User | Count |
|---|---|
| 24 | |
| 22 | |
| 20 | |
| 18 | |
| 14 |
| User | Count |
|---|---|
| 45 | |
| 38 | |
| 24 | |
| 22 | |
| 20 |