Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

transformation with power query

Good day to all master, again I am requesting your valuable help.

I need to transform the attached file here file source transformation

 

so that it looks like this

 

transformation final.png

 

Thanks in advance

 

 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

In Queries Editor, 

1.create a index column from1, 

 

2.create a conditional column 

14.png

 

3. fill down on [custom] column

 

4.click on [atributo] column, select "pivot table"

15.png

 

5.fill down in [nombre] column,

   fill up in [value] column,

   after these, click on the "down arrow" of  [type machine] column, select "remove empty"

16.png

 

finally, you could remove useless columns.

 

Best Regards

Maggie

View solution in original post

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

In Queries Editor, 

1.create a index column from1, 

 

2.create a conditional column 

14.png

 

3. fill down on [custom] column

 

4.click on [atributo] column, select "pivot table"

15.png

 

5.fill down in [nombre] column,

   fill up in [value] column,

   after these, click on the "down arrow" of  [type machine] column, select "remove empty"

16.png

 

finally, you could remove useless columns.

 

Best Regards

Maggie

Anonymous
Not applicable

@v-juanli-msft Thank you very much for the help, this is the answer I was looking for, just brilliant.
again thanks for coming to help me

Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

Try this one

 

let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
   ChangedType = Table.TransformColumnTypes(Source,{{"atributo", type text}, {"valores", type text}}),

Nombre=Table.SelectRows(ChangedType,each [atributo]="nombre")[valores],
typemachine=Table.SelectRows(ChangedType,each [atributo]="type machine")[valores],
value=Table.SelectRows(ChangedType,each [atributo]="value")[valores],
Final=Table.FromColumns({Nombre,typemachine,value},{"Nombre","type machine","value"})

in
    Final

@Anonymous

 

If you have many distinct values in Atributo column, its better to use List.Generate function to automate the transformation

 

Here is another way

Please see the attached Excel file as well

 

let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
   ChangedType = Table.TransformColumnTypes(Source,{{"atributo", type text}, {"valores", type text}}),
Mylist=List.Buffer(List.Distinct(ChangedType[atributo])),

IndividualLists=List.Generate(()=>

[Index=0,Mlist=Table.SelectRows(ChangedType,each [atributo]=Mylist{0})[valores]], 
each [Index] < List.Count(Mylist),
each [Index=[Index]+1,Mlist=Table.SelectRows(ChangedType,each [atributo]=Mylist{Index})[valores]],
each [Mlist]),
CombinedLists=List.Zip(IndividualLists),
ConvertedtoTable = Table.FromList(CombinedLists, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Added Custom" = Table.AddColumn(ConvertedtoTable, "Custom", each Text.Combine([Column1],",")),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Added Custom", "Custom", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), Mylist),
    #"Removed Columns" = Table.RemoveColumns(#"Split Column by Delimiter",{"Column1"})
in
    #"Removed Columns"

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors