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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.