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
Maggi029
Helper II
Helper II

How to combine duplicate rows and sum its values

How to combine duplicate rows and sum its values

 

Example of my table

 

CategoryItemsItems CountSell Date
FruitsApple    329/10/2021
FruitsApple    229/10/2021
VegetableCarrot    329/10/2021
VegetableCarrot    229/10/2021
FruitsApple    130/10/2021

 

I need to get my table like this:

 

CategoryItemsItems CountSell Date
FruitsApple      529/10/2021
VegetableCarrot      529/10/2021
FruitsApple      130/10/2021

 

How i can i acheive this?

1 ACCEPTED SOLUTION

Oh okay, In that case you can follow below steps:-

1. Click on group by option in edit query window:-

image.png 

2. Then select column as below and click OK:-

Samarth_18_0-1635486356014.png

3, You will see below output and then click on close and apply:-

Samarth_18_1-1635486411898.png

 

 

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

6 REPLIES 6
Samarth_18
Community Champion
Community Champion

Hi @Maggi029 ,

 

You can achive this by below two ways:-

 

1. Drag your column on table visual and use item count as sum 

image.png

 

2. Or You can create a custom table with below code:-

 

Table 2 =
SUMMARIZE (
    'Table',
    'Table'[Category],
    'Table'[Items],
    'Table'[Sell Date],
    "sum", SUM ( 'Table'[Items Count] )
)

 

Samarth_18_0-1635484141880.png

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Hi @Samarth_18 

 

Thanks for your response; it appears to be satisfactory; however, I must continue to use the old table in my project, as this will increase my pbix weight. My main goal is to reduce my pbix size, and to do so, I must trim down the table.

Oh okay, In that case you can follow below steps:-

1. Click on group by option in edit query window:-

image.png 

2. Then select column as below and click OK:-

Samarth_18_0-1635486356014.png

3, You will see below output and then click on close and apply:-

Samarth_18_1-1635486411898.png

 

 

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Hi @Samarth_18 

 

Thanks you for your answer

Anonymous
Not applicable

Hello @Maggi029 

You can create a simple measure and plot in the table/matrix.

Total Items = SUM'Table'[Items Count] )

Hi @Anonymous 

 

No instead of measure, i need to trim down my table rows count, for i need to combine my rows

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.