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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
coffeexyz
Regular Visitor

PowerQuery transform rows

Hi, 
I'm currently try to transform a datatable in PowerQuery, the format of the data is similar to this format

 

ITEM # Standard UOMAlt UOMFactor (Standard to ALT)
ITEM 1BOXEAa
ITEM 1BOXFT2b
ITEM 1BOXOZc
ITEM 1BOXPALd
ITEM 2BUCKETIN3e
ITEM 2BUCKETGALf
ITEM 2BUCKETLBg

 

Are there ways to transform this data into the following format, without splitting each ALT UOM into each individual tables? 

ITEM #ALT UOM convert to ALT UOM
ITEM 1EA to FT2 
ITEM 1EA to OZ 
ITEM 1EA to PAL 
ITEM 1

FT2 to PAL

ITEM 1

FT2 to OZ

ITEM 2

IN3 to GAL

ITEM 2

IN3 to LB

ITEM 2

GAL to LB

 

Many thanks for the advise!

1 ACCEPTED SOLUTION
rohit1991
Super User
Super User

Hi @coffeexyz ,
Yes, you can achieve this transformation in Power Query without having to manually split the Alt UOMs into separate tables. What you need is a self-join approach, where you join the table to itself based on matching ITEM #, then filter out combinations where the Alt UOM values are the same or already repeated in reverse.

 

This method allows you to generate all possible unique pairings of Alt UOMs per item and display them in the format you’re aiming for (e.g., "EA to FT2", "FT2 to PAL", etc.). After the self-join, you can use a conditional column or custom column to format the output string (e.g., [Alt UOM] & " to " & [Alt UOM.1]), then remove unnecessary columns. This way, you dynamically generate all conversions per item without needing separate tables for each UOM, keeping your transformation clean and scalable. Let me know if you'd like the exact Power Query steps or M code for this logic.


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

View solution in original post

3 REPLIES 3
v-ssriganesh
Community Support
Community Support

Hi @coffeexyz,

Thank you for posting your query in the Microsoft Fabric Community Forum, and thanks to @rohit1991 for sharing valuable insights.

 

Could you please confirm if your query has been resolved by the provided solution? If so, please mark it as the solution. This will help other community members solve similar problems faster.

Thank you.

rohit1991
Super User
Super User

Hi @coffeexyz ,
Yes, you can achieve this transformation in Power Query without having to manually split the Alt UOMs into separate tables. What you need is a self-join approach, where you join the table to itself based on matching ITEM #, then filter out combinations where the Alt UOM values are the same or already repeated in reverse.

 

This method allows you to generate all possible unique pairings of Alt UOMs per item and display them in the format you’re aiming for (e.g., "EA to FT2", "FT2 to PAL", etc.). After the self-join, you can use a conditional column or custom column to format the output string (e.g., [Alt UOM] & " to " & [Alt UOM.1]), then remove unnecessary columns. This way, you dynamically generate all conversions per item without needing separate tables for each UOM, keeping your transformation clean and scalable. Let me know if you'd like the exact Power Query steps or M code for this logic.


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
lbendlin
Super User
Super User

there is no discernible logic to your transformation request.  Please provide some more detail on how you get to the expected result.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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