Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Union and Row to generate a table with 2 columns

Hi all,

 

I have a first need to create a table as following:

_GrFon = UNION ( VALUES ( Orig_table[GF] ); ROW ( "GF"; "Others" ) )

Then a neww table 

_Equip = UNION ( VALUES ( Orig_table[Eq] ); ROW ( "Eq"; "Others" ) )

No I need to create the above but only in one table: means one table with the 2 columns GF and Eq

 

I don't know how to do it using union and row 😞

 

Could you please help on this?

 

Thanks,

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

are you adding the new row to your exisitng table? ->( Orig_table[GF] and  Orig_table[Eq] 

if so , than it is not possible adding row to the exisiting table as per the post below, however there is an alternative provided in this post.

 

https://community.powerbi.com/t5/Desktop/How-do-you-add-a-new-row-to-a-table/td-p/433083

 

or you just need to create a new fresh tables?

if so than here are the steps:

 

1-Hit on Dax New table

Capture 133.PNG

2,. 1st table:

GrFON = 
 ROW("GF","Other")

3. 2nd Table:

EQUIP = Row("EQ","Oth")

4. Merging these two tables.

GrFON = Union(EQUIP,
 ROW("GF","Other"))

Since now I am trying to merge EQUIP Table (2nd table) with GrFON (1st table), I get the output as :

oth is from 2nd table

 

Capture1345.PNG

 

 

Or if you dont want to create a calculated table, then simply hit on Enter Data in your home page:

Capture 123.PNG

Let me know if these works.

 

Thanks,

Tejaswi

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

If you have already cerated _GrFON and _Equip tables, than you can use Merge query feature in power Bi desktop.

https://community.powerbi.com/t5/Desktop/Joining-contents-of-two-tables-into-one-new-table/td-p/39775

 

May be this post is useful.

 

Thanks,

Tejaswi

 

Anonymous
Not applicable

Thanks for your reply.

They are calculated tables, I can't use Merge query ...

😞

Anonymous
Not applicable

Hi @Anonymous ,

 

are you adding the new row to your exisitng table? ->( Orig_table[GF] and  Orig_table[Eq] 

if so , than it is not possible adding row to the exisiting table as per the post below, however there is an alternative provided in this post.

 

https://community.powerbi.com/t5/Desktop/How-do-you-add-a-new-row-to-a-table/td-p/433083

 

or you just need to create a new fresh tables?

if so than here are the steps:

 

1-Hit on Dax New table

Capture 133.PNG

2,. 1st table:

GrFON = 
 ROW("GF","Other")

3. 2nd Table:

EQUIP = Row("EQ","Oth")

4. Merging these two tables.

GrFON = Union(EQUIP,
 ROW("GF","Other"))

Since now I am trying to merge EQUIP Table (2nd table) with GrFON (1st table), I get the output as :

oth is from 2nd table

 

Capture1345.PNG

 

 

Or if you dont want to create a calculated table, then simply hit on Enter Data in your home page:

Capture 123.PNG

Let me know if these works.

 

Thanks,

Tejaswi

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.