Forum Discussion

Almaz722's avatar
Almaz722
New Member
2 years ago
Solved

Tranform data from Rows

Dear all hi, 

I faced with problem in data preparation for our dashboards.

I Have dataset like this.

Name Value

AX
BY
CZ
AV
BO
CB

and i need to tranform it for propper calculation like this:

ABC
XYZ
VOB

Could you please help me. 

Thanks a lot, 

Almaz

  • Hi

    = Table.FromRows(
    List.Split(YourSource[Value],3),
    List.FirstN(YourSource[Name],3)
    )

     

    or

    let
    Source = YourSource,
    Group = Table.Group(Source, {"Name"}, {{"Values", each [Value], type list}}),
    Table = Table.FromColumns(Group[Values],Group[Name])
    in
    Table

    Stéphane 

4 Replies

  • Hi

    = Table.FromRows(
    List.Split(YourSource[Value],3),
    List.FirstN(YourSource[Name],3)
    )

     

    or

    let
    Source = YourSource,
    Group = Table.Group(Source, {"Name"}, {{"Values", each [Value], type list}}),
    Table = Table.FromColumns(Group[Values],Group[Name])
    in
    Table

    Stéphane 

    • Almaz722's avatar
      Almaz722
      New Member

      Hi, Stepane. 

      let
      Source = YourSource,
      Group = Table.Group(Source, {"Name"}, {{"Values", each [Value], type list}}),
      Table = Table.FromColumns(Group[Values],Group[Name])
      in
      Table

      Thank you, this option works greate on test excel file, but when i want to do same on CVS/TXT file, it is doesn't work. Also, as i see there are two options how steps in query marks. When i work with CVS/TXT steps starts #.