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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
stfnzmmrmnn
New Member

Combining rows based on two or more columns

Hi all, I am looking for a (easy) way to combine rows by some key vallues.

 

It's best explained by an example:

 

idtimezonetemperaturelongitudelatitude
1Berlin23nullnull
1Berlin070000008000000
2Berlin30nullnull
2Berlin060000005000000
2New York0nullnull
3Spain33nullnull
3Spain040000005500000

 

I am looking for a way to combine the rows by more than one key value (in this example only if id AND timezone is equal).

 

The result would be like this:

 

idtimezonetemperaturelongitudelatitude
1Berlin2370000008000000
2Berlin3060000005000000
2New York0nullnull
3Spain3340000005500000

 

 

I appreciate any help I can get!

 

Thank you very much!

 

Cheers

Stef

 

2 ACCEPTED SOLUTIONS
Zubair_Muhammad
Community Champion
Community Champion

Hi @stfnzmmrmnn

 

Try creating a Calculated Table from Modelling Tab>>>New Table

 

New Table =
SUMMARIZE (
    Table1,
    Table1[id],
    Table1[timezone],
    "temperature", SUM ( Table1[temperature] ),
    "Longitude", SUM ( Table1[longitude] ),
    "Latitude", SUM ( Table1[latitude] )
)

 

 

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

 

You can do this in the Query Editor.  Select the first two headings and right click > Group.  Select the SUM function there for the remaining three columns.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

 

You can do this in the Query Editor.  Select the first two headings and right click > Group.  Select the SUM function there for the remaining three columns.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Zubair_Muhammad
Community Champion
Community Champion

Hi @stfnzmmrmnn

 

Try creating a Calculated Table from Modelling Tab>>>New Table

 

New Table =
SUMMARIZE (
    Table1,
    Table1[id],
    Table1[timezone],
    "temperature", SUM ( Table1[temperature] ),
    "Longitude", SUM ( Table1[longitude] ),
    "Latitude", SUM ( Table1[latitude] )
)

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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