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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
JonasP
New Member

How to duplicate and amend rows based on column values

Hello community,

I have a dataset with revenue data from invoices where the type of revenue (e.g. service revenue, retail revenue, etc.) is defined by the expression in certain colums. I am looking for a way to split these invoices into multiple rows, depending of the values of the revenue type columns.

Here is an example for the dataset and the desired outcome:

JonasP_0-1666960927761.png


A solution for this would be so immensely helpful, so thank you very much in advance to anyone interested in looking into this!

 

 

1 ACCEPTED SOLUTION
Mikelytics
Resident Rockstar
Resident Rockstar

Hi Jonas,

 

There are many answers to your request. FIrst of all is that you can calculate the total using Measures afterwards or use the total functionality in the report view.

Mikelytics_0-1666965448601.png

 

Having other columns there which should not be duplciates you should consider splitting the tables into multiple tables because otherwise you have high amount of duplication or you have low amount of flexibility.  However from my understanding you should think about how your starschema model will look like. Because what you ask is not following star schema best practices.

 

I hope it helps you a little bit but it seems that there is a bigger picture which has to be clarified in your case.

 

Best regards

Michael

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your kudos.

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

View solution in original post

4 REPLIES 4
Mikelytics
Resident Rockstar
Resident Rockstar

Hi Jonas,

 

There are many answers to your request. FIrst of all is that you can calculate the total using Measures afterwards or use the total functionality in the report view.

Mikelytics_0-1666965448601.png

 

Having other columns there which should not be duplciates you should consider splitting the tables into multiple tables because otherwise you have high amount of duplication or you have low amount of flexibility.  However from my understanding you should think about how your starschema model will look like. Because what you ask is not following star schema best practices.

 

I hope it helps you a little bit but it seems that there is a bigger picture which has to be clarified in your case.

 

Best regards

Michael

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your kudos.

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

Hi Mike,
thank you very much for further elaboration.

My core problem is that the Total Net column has valid values, whereas the other columns are prone to errors as these are currently manually entered by my colleagues. That's why I cannot simply sum these values up to get correct Total Net.

 

But your answer indeed helped me to better understand the problem and the intricacies regarding the star scheme. I will now pursue fixing the problem in our datasource / process rather than in PowerBI.

Thank you very much!

Mikelytics
Resident Rockstar
Resident Rockstar

Hi JonasP,

 

In cases like this you would typically unpivpt the data to use it more flexible for any scenario. Can you please check whether this also brings you to your target?

 

Base Table

Mikelytics_0-1666961457085.png

 

Delete Total Column

Mikelytics_1-1666961485913.png

click on Invoice Nr column and use the "unpivot other columnns" feature

Mikelytics_2-1666961547578.png

result

Mikelytics_3-1666961569215.png

after you load the table you can do all kinds of stuff with the table since it is unpivoted.

 

Best regards

Michael

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your kudos.

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

Hi Michael,

first of all thank you for the quick and elaborate response.
This could be the way to do it, but I still have some limitations for my use case:

1. I will still need to retain the total Net Revenue column.
2. My Dataset contains numerous other columns that would have to clone their information to the new rows like the Invoice Nr. field in your example

Would this be possible?

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors