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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
smatsushima1
New Member

Help combining rows - keep getting error message

I need to combine the G, H, and I rows together because the first three G, H, and I rows have values in the last two columns but need to be updated to include the data in the last two rows.help1.PNG

I used this post to help me: https://community.powerbi.com/t5/Desktop/Combining-rows-based-on-unique-id-and-combining-information...

 

Basically unpovited the first column, then pivoted the newly created attribute column to the value column and didn't aggregate it. I ended up with this:

help2.PNG

help3.PNG

So I ended up with my desired result except that the names are now gone. Why is this and how do I remedy the situation? Thank you for all help.

 

1 ACCEPTED SOLUTION
KGrice
Memorable Member
Memorable Member

Hi @smatsushima1. Sometimes in pivot operations there are just too many options for the pivot and you end up with this error. That usually means we'll have to find a workaround, and I'm not sure you need to pivot based on your shown dataset. Are those all of your columns, and the only options are 1/0? If so, while in the Query Editor go to the Transform tab and click Group By (far left).

 

You'll want to group by Dealer Code and Dealer Name, and then add one column for each existing Feature column, defined as the Max of the column.

 

groupBy.PNG

 

I can't expand the window in the picture, but if you scrolled down you'd see the same setup for Features G and H. Doing this will get you to the same end result, but without the errors.

View solution in original post

2 REPLIES 2
v-haibl-msft
Microsoft Employee
Microsoft Employee

@smatsushima1

 

I tried with your table and post provided above but didn’t experience the issue you mentioned. Please refer to my Power Query which pasted from Advanced Editor to see if there is any difference with yours. You can also try the solution provided by KGrice.

 

let
    Source = Excel.Workbook(File.Contents("C:\Users\Herbert\Desktop\Power BI\Help combining rows - keep getting error message.xlsx"), null, true),
    Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(Sheet1_Sheet),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Dealer Code", Int64.Type}, {"Dealer Name", type text}, {"Feature A", Int64.Type}, {"Feature B", Int64.Type}, {"Feature C", Int64.Type}, {"Feature D", Int64.Type}, {"Feature E", Int64.Type}, {"Feature F", Int64.Type}, {"Feature G", Int64.Type}, {"Feature H", Int64.Type}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Dealer Code", "Dealer Name"}, "Attribute", "Value"),
    #"Pivoted Column" = Table.Pivot(#"Unpivoted Other Columns", List.Distinct(#"Unpivoted Other Columns"[Attribute]), "Attribute", "Value", List.Sum)
in
#"Pivoted Column"

 

Help combining rows - keep getting error message_1.jpg

 

Best Regards,

Herbert

KGrice
Memorable Member
Memorable Member

Hi @smatsushima1. Sometimes in pivot operations there are just too many options for the pivot and you end up with this error. That usually means we'll have to find a workaround, and I'm not sure you need to pivot based on your shown dataset. Are those all of your columns, and the only options are 1/0? If so, while in the Query Editor go to the Transform tab and click Group By (far left).

 

You'll want to group by Dealer Code and Dealer Name, and then add one column for each existing Feature column, defined as the Max of the column.

 

groupBy.PNG

 

I can't expand the window in the picture, but if you scrolled down you'd see the same setup for Features G and H. Doing this will get you to the same end result, but without the errors.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors