Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hi!
I am looking for help with removing duplicates when grouping, and adding a column. Or however, I can achieve the second table (i just started off with group-by and summing but that did not work because to double counts my rows).
Here is an example:
| Key ID | Gross Sales | Exempt Sales | NonTaxed Sales | Amount Subject to Tax | Sales Tax | Rate |
00001 | 100.00 | 0 | 0 | 100.00 | 6.00 | 6% |
| 00001 | 100.00 | 0 | 0 | 100.00 | 1.00 | 1% |
| 00001 | 100.00 | 0 | 0 | 100.00 | 0.50 | 0.5% |
| 00001 | 100.00 | 0 | 0 | 100.00 | 2.00 | 2% |
| 00002 | 50.00 | 0 | 50.00 | 0 | 0 | 0 |
| 00002 | 20.00 | 0 | 0 | 20.00 | 10.00 | 50% |
| 00003 | 75.00 | 75.00 | 0 | 0 | 0 | 0 |
| 00004 | 30.00 | 0 | 30.00 | 0 | 0 | 0 |
| 00004 | 10.00 | 0 | 0 | 10.00 | 1.00 | 10% |
| 00004 | 30.00 | 0 | 30.00 | 0 | 0 | 0 |
| 00004 | 10.00 | 0 | 0 | 10.00 | 2.00 | 20% |
Above we have instances where I there are duplicates in several columns. However, the driving factors are the Gross Sales and the Rate, along with the transaction ID. However, since there are different sales taxes depending on jurisdiction, the rows repeat for the transaction (even though they are blank since the exempt and non-taxable amount drive the rate (if there is something in this column then the rate is 0).
This is what I would like the column to look like.
| Key ID | Gross Sales | Exempt Sales | NonTaxed Sales | Amount Subject to Tax | Sales Tax | Rate |
00001 | 100.00 | 0 | 0 | 100.00 | 9.50 | 7.5% |
| 00002 | 70.00 | 0 | 50.00 | 20.00 | 10.00 | 50% |
| 00003 | 75.00 | 75.00 | 0 | 0 | 0 | 0 |
| 00004 | 40.00 | 0 | 30.00 | 10.00 | 3.00 | 30% |
I would like one row per key. If the values in each colum (per key) I would like them to be added, other wise they will be double counted and that is incorrect. So if the values are different, I would like them to be added.
Thank you!
Solved! Go to Solution.
@pbiwizard You don't need to create a new table, just add measure for each column and then use that in the visual, here is the example of the measure for Gross Sales
Gross Sales M =
SUMX (
SUMMARIZE ( TableSum, TableSum[Key ID], TableSum[Gross Sales] ),
[Gross Sales]
)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@pbiwizard You don't need to create a new table, just add measure for each column and then use that in the visual, here is the example of the measure for Gross Sales
Gross Sales M =
SUMX (
SUMMARIZE ( TableSum, TableSum[Key ID], TableSum[Gross Sales] ),
[Gross Sales]
)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
| User | Count |
|---|---|
| 50 | |
| 43 | |
| 36 | |
| 33 | |
| 30 |
| User | Count |
|---|---|
| 139 | |
| 128 | |
| 60 | |
| 59 | |
| 57 |