cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
MBOVEO Frequent Visitor
Frequent Visitor

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

Accepted Solutions
tejaswidmello Established Member
Established Member

Re: Union and Row to generate a table with 2 columns

Hi @MBOVEO ,

 

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
tejaswidmello Established Member
Established Member

Re: Union and Row to generate a table with 2 columns

Hi @MBOVEO ,

 

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/3977...

 

May be this post is useful.

 

Thanks,

Tejaswi

 

MBOVEO Frequent Visitor
Frequent Visitor

Re: Union and Row to generate a table with 2 columns

Thanks for your reply.

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

😞

tejaswidmello Established Member
Established Member

Re: Union and Row to generate a table with 2 columns

Hi @MBOVEO ,

 

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

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)