To implement this recipe, do the following:
- Create the following table, that is, R04_Transpose:
R04_Transpose =
VAR __Table = 'R04_Table'
VAR __Transpose =
SELECTCOLUMNS(
{
(
SELECTCOLUMNS(
FILTER(
__Table,
[Index]=1
),
"Row",[Column1]
),
SELECTCOLUMNS(
FILTER(
__Table,
[Index]=2
),
"Row",[Column1]
),
"1"
),
(
SELECTCOLUMNS(
FILTER(
__Table,
[Index]=1
),
"Row",[Column2]
),
SELECTCOLUMNS(
FILTER(
__Table,
[Index]=2
),
"Row",[Column2]
),
"2"
),
(
SELECTCOLUMNS(
FILTER(
__Table,
[Index]=1
),
"Row",[Column3]
),
SELECTCOLUMNS(
FILTER(
__Table,
[Index]=2
),
"Row",[Column3]
),
"3"
)
},
"Row",[Value3],
"1",[Value1],
"2",[Value2]
)
RETURN
__Transpose