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.
Hi all,
I would like to sum the values in the column "amount" for all unique values in column "merchant-order-id" and only keep the uniqe value of "merchant-order-id" with the summed "amount".
I hope my question is clear. Thank you!
Solved! Go to Solution.
Yes. Just add all the columns you want to keep here:
NewTable = SUMMARIZE(YourTable, YourTable[merchant-order-id], COLUMN1, COLUMN2, "Amount", sum(YourTable[Amount]))
PS.: if you think my answer solves your problem, don't forget to mark the post as solution. 🙂
Regards.
Hi pedrams.
SUMMARIZE function can do that to you. Docs and samples here: https://msdn.microsoft.com/en-us/query-bi/dax/summarize-function-dax
At a glance, just go to "Modeling" and select "New Table". For your sample data it would be something like:
NewTable = SUMMARIZE(YourTable, YourTable[merchant-order-id], "Amount", sum(YourTable[Amount]))
In the formula above, "YourTable" should be changed to your current data table, which you did not mention. "New Table" could be renamed to anything you like.
Regards.
Hi Marco,
thank you for the solution. But I lose all the other columns, how can I keep all the other columns?
Best,
Pedram
Yes. Just add all the columns you want to keep here:
NewTable = SUMMARIZE(YourTable, YourTable[merchant-order-id], COLUMN1, COLUMN2, "Amount", sum(YourTable[Amount]))
PS.: if you think my answer solves your problem, don't forget to mark the post as solution. 🙂
Regards.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |