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
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
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.