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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
damit230183
Helper I
Helper I

Conversion of Columns into Rows with Group by Function

Hi,

I have been working on one report where I need to conver columns into rows and make that rows as Header.

This is what I have:

 

damit230183_0-1752003996678.png

 

This is what the result should look like

damit230183_1-1752004228419.png

Any help or suggestion would appreciate it.

 

Thanks in Advance for your inputs.

2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi,

Please try to use Table.Pivot M code.

Jihwan_Kim_0-1752005965804.png

 

Table.Pivot - PowerQuery M | Microsoft Learn

 

let
    Source = source,
    #"Pivoted Column" = Table.Pivot(Source, List.Distinct(Source[field1]), "field1", "field2")
in
    #"Pivoted Column"

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

View solution in original post

MasonMA
Super User
Super User

@damit230183 

 

Hi, you can pivot the column through Power Query UI as well:

1. Select Field 1 column, under Transform click Pivot. 

MasonMA_1-1752006313935.png

2. In Pivot window, Select 'Field 2' for Value Column and 'Dont aggregate' for Aggregate Value Function. 

MasonMA_0-1752006263914.png

Hope this makes it simpler:) 

View solution in original post

3 REPLIES 3
damit230183
Helper I
Helper I

 Thank you both for your response.

 

Both solution worked perfectily as expected.

 

Thanks

MasonMA
Super User
Super User

@damit230183 

 

Hi, you can pivot the column through Power Query UI as well:

1. Select Field 1 column, under Transform click Pivot. 

MasonMA_1-1752006313935.png

2. In Pivot window, Select 'Field 2' for Value Column and 'Dont aggregate' for Aggregate Value Function. 

MasonMA_0-1752006263914.png

Hope this makes it simpler:) 

Jihwan_Kim
Super User
Super User

Hi,

Please try to use Table.Pivot M code.

Jihwan_Kim_0-1752005965804.png

 

Table.Pivot - PowerQuery M | Microsoft Learn

 

let
    Source = source,
    #"Pivoted Column" = Table.Pivot(Source, List.Distinct(Source[field1]), "field1", "field2")
in
    #"Pivoted Column"

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.