Forum Discussion
Pivot multiple value
- Anonymous2 years ago
Hi Mars3442 ,
Please follow these steps:
1.Create a calculation table and write the following expression.
Table 2 = var _table1= DISTINCT('Table'[Customer]) return ADDCOLUMNS( _table1, "M01", CONCATENATEX( FILTER(ALL('Table'), 'Table'[Customer]=EARLIER('Table'[Customer])&&'Table'[Period]=1),'Table'[Vehicle],","), "M02", CONCATENATEX( FILTER(ALL('Table'), 'Table'[Customer]=EARLIER('Table'[Customer])&&'Table'[Period]=2),'Table'[Vehicle],",") )2.The result obtained is shown below.
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 2 years ago
Hi,
1. Transform "Period" 1, 2, ... --> M01, M02, ...
2. Pivot with Text.Combine
let
Source = Your_Source,
Period = Table.TransformColumns(Source, {{"Period", each "M" & Number.ToText(_, "00"), type text}}),
Pivot = Table.Pivot(Period, List.Distinct(Period[Period]), "Period", "Vehicle", each Text.Combine(_, ", "))
in
PivotStéphane
Hi Mars3442 ,
Please follow these steps:
1.Create a calculation table and write the following expression.
Table 2 =
var _table1=
DISTINCT('Table'[Customer])
return
ADDCOLUMNS(
_table1,
"M01",
CONCATENATEX(
FILTER(ALL('Table'),
'Table'[Customer]=EARLIER('Table'[Customer])&&'Table'[Period]=1),'Table'[Vehicle],","),
"M02",
CONCATENATEX(
FILTER(ALL('Table'),
'Table'[Customer]=EARLIER('Table'[Customer])&&'Table'[Period]=2),'Table'[Vehicle],",")
)
2.The result obtained is shown below.
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.