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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
data123456789
Regular Visitor

combining 2 rows into 1 by ID

Hi everybody,

 

i am searching the forum the whole day but couldnt find a solution which fits.

 

i am looking at following table

 

ID             time              A            B             C

1234          xxx               5            10           null

1234          xxx              null        null           100

 

I already used pivot to get this far so unpivoting doesnt work

 

final result should be

 

 

ID             time              A            B             C

1234          xxx               5            10           100

 

Thank you for your help

3 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

@data123456789 - In Power Query editor you should be able to use Group By



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

AlB
Community Champion
Community Champion

Hi @data123456789 

Use Group By. Make sure that what you show as "null" in your table is actually of type null in the table (and not the string null)

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQyNlHSUaqoqACSpkBsaAAklGJ10KQgyNDAQCk2FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Time = _t, A = _t, B = _t, C = _t]),
    #"Grouped Rows" = Table.Group(Source, {"ID", "Time"}, {{"A", each List.Max([A]), type text}, {"B", each List.Max([B]), type text},{"C", each List.Max([C]), type text}})
in
    #"Grouped Rows"

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

View solution in original post

v-lili6-msft
Community Support
Community Support

HI @data123456789 

You could get it by use Group By in Edit Queries:

https://support.microsoft.com/en-us/office/group-rows-in-a-table-power-query-e1b9e916-6fcc-40bf-a6e8...

 

4.JPG

 

Result:

5.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

HI @data123456789 

You could get it by use Group By in Edit Queries:

https://support.microsoft.com/en-us/office/group-rows-in-a-table-power-query-e1b9e916-6fcc-40bf-a6e8...

 

4.JPG

 

Result:

5.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
AlB
Community Champion
Community Champion

Hi @data123456789 

Use Group By. Make sure that what you show as "null" in your table is actually of type null in the table (and not the string null)

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQyNlHSUaqoqACSpkBsaAAklGJ10KQgyNDAQCk2FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Time = _t, A = _t, B = _t, C = _t]),
    #"Grouped Rows" = Table.Group(Source, {"ID", "Time"}, {{"A", each List.Max([A]), type text}, {"B", each List.Max([B]), type text},{"C", each List.Max([C]), type text}})
in
    #"Grouped Rows"

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

Greg_Deckler
Community Champion
Community Champion

@data123456789 - In Power Query editor you should be able to use Group By



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors