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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
AllanBerces
Post Prodigy
Post Prodigy

Column to Row

Hi good day, is it possible in PQ or Summurized table to combine the value in my column into row something like this

AllanBerces_0-1780377935887.png

OUTPUT

AllanBerces_1-1780378016654.png

LocationTask
shfh-y099812345trtr
gfhdgh-354y12345trtr
45-dgfd565656kjhjhkh
fdhdh098-5565656kjhjhkh
hdfhtrh-453565656kjhjhkh
yuryt7865tryer6666
tjrtyuyjjfyutryer6666
hdgftryer6666
3 ACCEPTED SOLUTIONS
Kedar_Pande
Super User
Super User

@AllanBerces 

 

Yes, do this in Power Query.

Select the Task column, then Group By.
Group by Task, create a new column as "All Rows" operation.
Add a custom column: Text.Combine([AllRows][Location], ", ")
Remove the AllRows column.

 

If this answer helped, please click 👍 or Accept as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande

View solution in original post

SamInogic
Solution Sage
Solution Sage

Hi,

 

Yes, this is possible in Power Query using Group By + Text.Combine.

Steps in Power Query

  1. Open Power Query Editor
  2. Select the Task column
  3. Go to Transform → Group By
  4. Group by Task
  5. Add a custom aggregation for Location

Use this M code example:

Table.Group(

    Source,

    {"Task"},

    {

        {"Location", each Text.Combine([Location], ", "), type text}

    }

)

Expected Output

Task

Location

12345trtr

shfh-y0998, gfhdgh-354y

565656kjhjhkh

45-dgfd, fdhdh098-5, hdfhtrh-453

tryer6666

yuryt7865, tjrtyuyjjfyu, hdgf

This will combine all Location values into a single row separated by commas based on the same Task.

You can also do this in DAX using CONCATENATEX(), but Power Query is the better approach if you want a summarized table and improved performance.

 

Hope this helps!

 

Thanks!

Inogic Professional Services: Power Platform/Dynamics 365 CRM
An expert technical extension for your techno-functional business needs
Service: https://www.inogic.com/services/
Tips and Tricks: https://www.inogic.com/blog/

View solution in original post

Hi @AllanBerces
You're already at the Grouped Rows step. The only thing missing is converting the nested table into a comma-separated list of locations.

Replace:

#"Grouped Rows" = Table.Group(#"Renamed Columns", {"TASK"}, {{"Count", each _, type table [TASK=text, LOCATION=nullable text]}})

with:

#"Grouped Rows" =
Table.Group(
#"Renamed Columns",
{"TASK"},
{
{
"LOCATION",
each Text.Combine(
List.Transform([LOCATION], Text.From),
", "
),
type text
}
}
)

Then keep:

in
#"Grouped Rows"

This will give you one row per TASK and combine all LOCATION values into a single field separated by commas.

View solution in original post

6 REPLIES 6
SamInogic
Solution Sage
Solution Sage

Hi,

 

Yes, this is possible in Power Query using Group By + Text.Combine.

Steps in Power Query

  1. Open Power Query Editor
  2. Select the Task column
  3. Go to Transform → Group By
  4. Group by Task
  5. Add a custom aggregation for Location

Use this M code example:

Table.Group(

    Source,

    {"Task"},

    {

        {"Location", each Text.Combine([Location], ", "), type text}

    }

)

Expected Output

Task

Location

12345trtr

shfh-y0998, gfhdgh-354y

565656kjhjhkh

45-dgfd, fdhdh098-5, hdfhtrh-453

tryer6666

yuryt7865, tjrtyuyjjfyu, hdgf

This will combine all Location values into a single row separated by commas based on the same Task.

You can also do this in DAX using CONCATENATEX(), but Power Query is the better approach if you want a summarized table and improved performance.

 

Hope this helps!

 

Thanks!

Inogic Professional Services: Power Platform/Dynamics 365 CRM
An expert technical extension for your techno-functional business needs
Service: https://www.inogic.com/services/
Tips and Tricks: https://www.inogic.com/blog/

Hi @SamInogic @Kedar_Pande thank you, i got it.

Hi @Kedar_Pande @SamInogic sorry but Im frezz on this

let
Source = #"115MRR",
#"Merged Columns" = Table.CombineColumns(Source,{"ACCOUNT NO", "MATERIAL CODE"},Combiner.CombineTextByDelimiter("-", QuoteStyle.None),"WON-ARTICLE No."),
#"Removed Other Columns" = Table.SelectColumns(#"Merged Columns",{"WON-ARTICLE No.", "LOCATION"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Other Columns",{{"WON-ARTICLE No.", "TASK"}}),
#"Grouped Rows" = Table.Group(#"Renamed Columns", {"TASK"}, {{"Count", each _, type table [TASK=text, LOCATION=nullable text]}})
in
#"Grouped Rows"

Hi @AllanBerces
You're already at the Grouped Rows step. The only thing missing is converting the nested table into a comma-separated list of locations.

Replace:

#"Grouped Rows" = Table.Group(#"Renamed Columns", {"TASK"}, {{"Count", each _, type table [TASK=text, LOCATION=nullable text]}})

with:

#"Grouped Rows" =
Table.Group(
#"Renamed Columns",
{"TASK"},
{
{
"LOCATION",
each Text.Combine(
List.Transform([LOCATION], Text.From),
", "
),
type text
}
}
)

Then keep:

in
#"Grouped Rows"

This will give you one row per TASK and combine all LOCATION values into a single field separated by commas.

Kedar_Pande
Super User
Super User

@AllanBerces 

 

Yes, do this in Power Query.

Select the Task column, then Group By.
Group by Task, create a new column as "All Rows" operation.
Add a custom column: Text.Combine([AllRows][Location], ", ")
Remove the AllRows column.

 

If this answer helped, please click 👍 or Accept as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande

Hi @Kedar_Pande sorry but i cannot get, can help on the sample

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.