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
JenaT
Frequent Visitor

Split a cell into multiple rows and calculating values

I have invoice data (product names and purchased pieces aggregated on 1 row) that I need to transform into sales data, i.e. disaggregate the product name from the nr of pieces and also split the sales value between the products.

An illustration of the data and the required result is below:

 

image.png

My logic was that I can split the products from the purchase amounts by separator "-" into multiple columns, then somehow split them into rows, but how do make the sales value calculations (e.g. look at the latest purchase of the same product and take the value from there)?

There could be up to 5 products purchased in a single invoice that we need to split all into different rows.

 

 

1 ACCEPTED SOLUTION

Hi @JenaT,

 

The question is how you make that split is the unit price always the same for the same invoice?

 

You have several quantities but only one line for total value, what is the rule to get the split per product?

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

@JenaT,

 

Is your information with a line break a you present in you sample data?

 

If so you have to first split the cell by row by the line break simbol "#(lf)" and then make the split by columns by the "-".

 

Be aware that taking into account the sales columns you present the calculation of the Sales will bee repeat in all of your columns so the second row you present will have:

Jill | 13/07/2018 | Product 1 - 1 | 50

Jill | 13/07/2018 | Product 2 - 4 | 50

 

See below the screenshots and attach a PBIX file.

 

line break.pngcolumn.pngFinal_result.png

 

Regards,

MFelix

 

 

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



JenaT
Frequent Visitor

 

Thanks, I did not know about the line feed.

But I am still presented with the problem of splitting sales amounts between the products. Is there any possible solution to that using the advanced editor for example or any other way?

Hi @JenaT,

 

The question is how you make that split is the unit price always the same for the same invoice?

 

You have several quantities but only one line for total value, what is the rule to get the split per product?

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.