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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors