Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hi All,
I have tried using pivot and unpivot and transposing but can't quite figure out how to transform my table from this:
Any help would be appreciated
| Part Num | To Part |
| CCXCV | C7XTN |
| CCXCV | P5YFN |
| CCXCV | TNTCT |
to this:
| Part Num | Dev1 | Dev2 | Dev3 |
| CCXCV | C7XTN | P5YFN | TNTCT |
Solved! Go to Solution.
Hi, please check the below picture and the attached pbix file.
I am not sure how it is defined to understand what comes for Dev1 / Dev2 / Dev3, but I hope you get the ideas on how to create the solution for your business logic.
New Table =
ADDCOLUMNS (
VALUES ( Data[Part Num] ),
"Dev1",
CALCULATE (
MAX ( Data[To Part] ),
INDEX (
1,
SUMMARIZE (
FILTER ( Data, Data[Part Num] = EARLIER ( Data[Part Num] ) ),
Data[To Part]
),
ORDERBY ( Data[To Part] )
)
),
"Dev2",
CALCULATE (
MAX ( Data[To Part] ),
INDEX (
2,
SUMMARIZE (
FILTER ( Data, Data[Part Num] = EARLIER ( Data[Part Num] ) ),
Data[To Part]
),
ORDERBY ( Data[To Part] )
)
),
"Dev3",
CALCULATE (
MAX ( Data[To Part] ),
INDEX (
3,
SUMMARIZE (
FILTER ( Data, Data[Part Num] = EARLIER ( Data[Part Num] ) ),
Data[To Part]
),
ORDERBY ( Data[To Part] )
)
)
)
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
It is for creating a new table by using DAX.
New Table =
ADDCOLUMNS (
VALUES ( Data[Part Num] ),
"Dev1",
CALCULATE (
MAX ( Data[To Part] ),
INDEX ( 1, SUMMARIZE ( Data, Data[To Part] ), ORDERBY ( Data[To Part] ) )
),
"Dev2",
CALCULATE (
MAX ( Data[To Part] ),
INDEX ( 2, SUMMARIZE ( Data, Data[To Part] ), ORDERBY ( Data[To Part] ) )
),
"Dev3",
CALCULATE (
MAX ( Data[To Part] ),
INDEX ( 3, SUMMARIZE ( Data, Data[To Part] ), ORDERBY ( Data[To Part] ) )
)
)
@Jihwan_Kim you understood the concept. Thank you.
This is very odd, and may be because I am a new user but I can't reply with a .pbix file like you did.
I am unable to get what you produced to work and might be because I provided partial data. Here is a larger sample size which has different parts and different deviations that would have to be transposed:
| Part Num | To Part |
| CCR41 | JW30H |
| CCXCV | C7XTN |
| CCXCV | P5YFN |
| CCXCV | TNTCT |
| CC0F0 | G6R99 |
| CC0F0 | 56D99 |
| CDDMJ | XX7MT |
| CF4C1 | CC0F0 |
| CGNVH | 6KNWW |
| CG0M0 | K18NP |
| CG48D | 0W8VV |
| CJMMK | 6FDH8 |
| CJX0F | WV4KK |
| CMFND | 6M9N4 |
| CMPGM | Y26KX |
| CM9TJ | X3PK1 |
| CPFWH | WCF6J |
| CPFWH | 2N6C5 |
| CP610 | 6JKXY |
| CR72X | 68ND3 |
| CTWCN | C8T2P |
| CTWCN | MGPPC |
to look like this:
| Part Num | Dev1 | Dev2 | Dev3 |
| CCR41 | JW30H | ||
| CCXCV | C7XTN | P5YFN | TNTCT |
| CC0F0 | G6R99 | 56D99 | |
| CDDMJ | XX7MT | ||
| CF4C1 | CC0F0 | ||
| CGNVH | 6KNWW | ||
| CG0M0 | K18NP | ||
| CG48D | 0W8VV | ||
| CJMMK | 6FDH8 | ||
| CJX0F | WV4KK | ||
| CMFND | 6M9N4 | ||
| CMPGM | Y26KX | ||
| CM9TJ | X3PK1 | ||
| CPFWH | WCF6J | 2N6C5 | |
| CP610 | 6JKXY | ||
| CR72X | 68ND3 | ||
| CTWCN | C8T2P | MGPPC |
Hi, please check the below picture and the attached pbix file.
I am not sure how it is defined to understand what comes for Dev1 / Dev2 / Dev3, but I hope you get the ideas on how to create the solution for your business logic.
New Table =
ADDCOLUMNS (
VALUES ( Data[Part Num] ),
"Dev1",
CALCULATE (
MAX ( Data[To Part] ),
INDEX (
1,
SUMMARIZE (
FILTER ( Data, Data[Part Num] = EARLIER ( Data[Part Num] ) ),
Data[To Part]
),
ORDERBY ( Data[To Part] )
)
),
"Dev2",
CALCULATE (
MAX ( Data[To Part] ),
INDEX (
2,
SUMMARIZE (
FILTER ( Data, Data[Part Num] = EARLIER ( Data[Part Num] ) ),
Data[To Part]
),
ORDERBY ( Data[To Part] )
)
),
"Dev3",
CALCULATE (
MAX ( Data[To Part] ),
INDEX (
3,
SUMMARIZE (
FILTER ( Data, Data[Part Num] = EARLIER ( Data[Part Num] ) ),
Data[To Part]
),
ORDERBY ( Data[To Part] )
)
)
)
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 23 | |
| 21 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 58 | |
| 55 | |
| 43 | |
| 30 | |
| 24 |