cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AGo Resolver I
Resolver I

Union of 2 calculated columns from a single table

I have a table with 4 CALCULATED cols:

Col1 Col2 Col3 Col4

Val1  Val2 Val3 Val4

Val5  Val6 Val7 Val8

 

 

I want to to create a new table with a single column which has values from Col2 and col3:

ie. NewCol

    Val2

    Val3

    Val6

    Val7 

 

Is this possible?

1 ACCEPTED SOLUTION

Accepted Solutions
Vvelarde Community Champion
Community Champion

Re: Union of 2 calculated columns from a single table

@AGo

 

Following the post of @jessicammoss

 

You can simplified this doing: 

Create a New Table:

 

Table = UNION(VALUES(Table1[Col2]),VALUES(Table1[Col3]))




Lima - Peru

View solution in original post

4 REPLIES 4
ankitpatira Community Champion
Community Champion

Re: Union of 2 calculated columns from a single table

@AGo in power bi desktop, go to query editor (Edit Queries) and highlight column col2 and col3 and under Transform tab click Unpivot Columnns. Then remove unwanted columns.

 

Capture.PNG

AGo Resolver I
Resolver I

Re: Union of 2 calculated columns from a single table

This is the query editor, it doesn't contain the calculated columns of Power BI Desktop.

jessicammoss Advocate I
Advocate I

Re: Union of 2 calculated columns from a single table

Assuming a base table of "CalcColTable", and column names as described, I think this expression for a new table will work.  I'm not sure if there's a way to refactor the expression and make it simpler, but it produces the right outcome.

 

NewTable = UNION(CALCULATETABLE(SELECTCOLUMNS(CalcColTable, "NewCol", CalcColTable[Col2])), SELECTCOLUMNS(CalcColTable, "NewCol", CalcColTable[Col3]))

 

HTH,

Jessica

Vvelarde Community Champion
Community Champion

Re: Union of 2 calculated columns from a single table

@AGo

 

Following the post of @jessicammoss

 

You can simplified this doing: 

Create a New Table:

 

Table = UNION(VALUES(Table1[Col2]),VALUES(Table1[Col3]))




Lima - Peru

View solution in original post

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors