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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
michal_boro
Frequent Visitor

How to multiply rows depending on the results

Hi i ve got data as shown in the example below

IDPackage 
1[barcode1], [barcode2], 
2[barcode1], [barcode2], [barcode3]
3barcode1]

 

And using Power Query, I would like to receive it in the format shown below. Could you please assist me?

 

IDPackage 
1[barcode1]
1[barcode2]
2[barcode1]
2[barcode2]
2[barcode3]
3[barcode1]

 

1 ACCEPTED SOLUTION
Omid_Motamedise
Super User
Super User

consider your data as below

Omid_Motamedise_0-1733877302653.png

 

select Package column and go to home tab and select split column and make the below changes over it

 

Omid_Motamedise_1-1733877322088.png

 

press ok to find the result as below

Omid_Motamedise_2-1733877331374.png


finally filter blank cellls

If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h

View solution in original post

2 REPLIES 2
Omid_Motamedise
Super User
Super User

consider your data as below

Omid_Motamedise_0-1733877302653.png

 

select Package column and go to home tab and select split column and make the below changes over it

 

Omid_Motamedise_1-1733877322088.png

 

press ok to find the result as below

Omid_Motamedise_2-1733877331374.png


finally filter blank cellls

If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h
ZhangKun
Super User
Super User

1 to 2

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUYpOSixKzk9JNYzVUYCxjWKVYnWilYxwSiPYxhClxihKlWJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Package = _t]), 
    result = Table.ExpandListColumn(Table.TransformColumns(Source, {"Package", each List.Transform(Text.Split(_, ","), Text.Trim)}), "Package")
in
    result

2 to 1

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUYpOSixKzk9JNYxVitVBFTKCCBlhqjLCr8oYImSMpjEWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Package = _t]),
    Group = Table.Group(Source, {"ID"}, {{"Package", each Text.Combine(_[Package], ","), Int64.Type}})
in
    Group

 

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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