Forum Discussion
Combining several columns and creating cascading structure
Hi Guys,
I am working on a problem i have. Hopefully someone can help me with it.
I created a unique new Table outof my main data source that looks like this. Value 1 and 2 are Meassures or i can change them to new Columns whichever is needed.
| ID | Value 1 | Value 2 |
| 1 | 10 | 15 |
| 2 | 20 | 25 |
| 3 | 30 | 35 |
Out of this i would like to create a cascaded structure like this.
| ID | Value |
| 1 | 10 |
| 2 | 20 |
| 3 | 30 |
| 1 | 15 |
| 2 | 25 |
| 3 | 35 |
Is there any way how to do it?
Thx for any advice.
Actually the function you need (to avoid including other columns which ADDCOLUMNS does) is SELECTCOLUMNS. My apologies.
Here is the example:
5 Replies
- PaulDBrown
Community Champion
If you create the table in Power Query, all you have to do is unpivot both values columns
- stanislav_dugas
Helper III
Problem is I cant access this table in query editor since it was created as a new table by using Groupby function from the main data table.
- PaulDBrown
Community Champion
Ok. Try:
New table =
VAR _table1 = ADDCOLUMNS(Table, "ID", Table [ID], "Value", Table [Value 1])
VAR _table2 = ADDCOLUMNS(Table, "ID", Table [ID], "Value" Table [Value 2])
RETURN
UNION(_table1, _table2)