cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mkittell
New Member

How to transform like rows into like columns of data

I'm looking to take my table of values that has similar terms in the one column and group those terms and their respective data into columns of their own. 

 

mkittell_0-1654720617489.png

 

image.pngimage.pngimage.png

 

My goal is to produce the result shown in the image above. I can do so manually by expanding all the columns, but I won't know the names or number of the columns in the future. I would like to be able to generate these columns dynamically regardless of the names of the like terms nor the number of like terms. (ie. TM1,  010ST, etc.)

 

The goal of this is to produce seperate data series for each name to plot a chart and format that series seperately. I can do so manually for a previously determined set of values, but cannot determine a way to do so dynamically.

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

NewStep=let a=Table.Group(PreviousStepName,"Name",{"n",each [Merged]}) in Table.FromColumns(a[n],a[Name])

View solution in original post

2 REPLIES 2
mkittell
New Member

Thank you so much, I've spent far too many hours trying to figure this out on my own!

 

I'm still just learning to code in M, would you be able to provide any further explanation so I might better understand this solution?

wdx223_Daniel
Super User
Super User

NewStep=let a=Table.Group(PreviousStepName,"Name",{"n",each [Merged]}) in Table.FromColumns(a[n],a[Name])

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors