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! Request now

Reply
BInovice
Frequent Visitor

Calculation between rows with same ID

All, my data are structured as below and I need to run the calculated values in the last column. Each ID contains exact same 4 attributes. 

IDAttributeValueCal=(A+C+D)/B
ID1A6 
ID1B2 
ID1C3 
ID1D15
ID2A100 
ID2B40 
ID2C56 
ID2D896.125

 

Alternatively a way to unpivot the table to the following would do, but I could not quite figure it out.

IDABCDCal=(A+C+D)/B
ID162315
ID21004056896.125

 

Any helps are greatly appreciated.

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

You can easily unpivot in the query editor. Select the Attribute column and under the Transform tab, choose Pivot column.

AlexisOlson_0-1637098047696.png

Then Add Column > Custom Column

AlexisOlson_1-1637098124304.png

 

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

You can easily unpivot in the query editor. Select the Attribute column and under the Transform tab, choose Pivot column.

AlexisOlson_0-1637098047696.png

Then Add Column > Custom Column

AlexisOlson_1-1637098124304.png

 

Thank you @AlexisOlson . The solution works magic

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.