The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Is there a way that I can merge the values based on multiple columns?
My table is below with the layout of the data.
What I want to happen is if the Client, Item number, the description and the price is the same then it would sum the quantity and merge them all into one row.
Date | Client | Item Number | Description | Price | Quantity | Invoice No. |
14/01/2022 | John Doe | 04_102_0136_6_1_T | Group Activities | 59.88 | 1 | 6370 |
14/01/2022 | John Doe | 04_102_0136_6_1_T | Group Activities | 59.88 | 2.5 | 6370 |
14/01/2022 | John Doe | 04_102_0136_6_1_T | Group Activities | 59.88 | 3.33 | 6370 |
14/01/2022 | John Doe | 04_104_0125_6_1_T | Grp Non Face to Face | 59.67 | 1.5 | 6370 |
14/01/2022 | John Doe | 04_599_0136_6_1 | Community Groups | 2.17 | 1.67 | 6370 |
14/01/2022 | John Doe | 04_599_0136_6_1 | Community Groups | 2.17 | 2.5 | 6370 |
14/01/2022 | John Doe | 04_599_0136_6_1 | Community Groups | 2.17 | 4 | 6370 |
14/01/2022 | John Doe | 04_599_0136_6_1 | Group Activities | 2.17 | 1 | 6370 |
14/01/2022 | John Doe | 04_599_0136_6_1 | Group Activities | 2.17 | 2.5 | 6370 |
14/01/2022 | John Doe | 04_599_0136_6_1 | Group Activities | 2.17 | 3.33 | 6370 |
Solved! Go to Solution.
Hi @ITMSPMAN ,
If you add your Client, Item number, the description and the price columns on your visual and mark price column summerized as sum then it will give you expected output.
Or if you want to do it explicitly then you can use below measure:-
Measure = sumx(SUMMARIZE('Table','Table'[Item Number],'Table'[Client],'Table'[Description],"Sum",CALCULATE(SUM('Table'[Price]))),[Sum])
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 @ITMSPMAN ,
If you add your Client, Item number, the description and the price columns on your visual and mark price column summerized as sum then it will give you expected output.
Or if you want to do it explicitly then you can use below measure:-
Measure = sumx(SUMMARIZE('Table','Table'[Item Number],'Table'[Client],'Table'[Description],"Sum",CALCULATE(SUM('Table'[Price]))),[Sum])
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
I figured out why I couldn't get it working, I had the quantity field as a text so it wasn't summarising.
I have it all working now, thankyou for pointing me in the right direction.