- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Group row data and add as a new column
Hello everybody,
if have the following example:
Source Table
Order No - Amount - Group
1000 - 100€ - A
2000 - 200€ - A
3000 - 400€ - B
The result should be a table like this:
Order No - Amount - Group - Group Amount
1000 - 100€ - A - 300€
2000 - 200€ - A - 300€
3000 - 400€ - B - 400€
I think, I have to do create a calculated column with calculation and a kind of allselected or simular.
But I don't get it, to group or filter bei the column "Group".
Can somebody help?
Kind regards,
Tristan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@TristanKuesters What I would suggest easiest option would be is to go to power bi desktop query editor -> right click your original query and click Reference. This would create another query that is referenced original. Then for the second group do Group By via Transorm tab that will give you sum of Amount by Group. Close&Apply and then create relationship between two queries using Group column.
So you will end up with query that is grouped by sum of amount like how you wanted and you will also have original query that also contains order number column.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tristan,
A much easier solution is to choose "Merge Queries" in Query Editor in the original query. Then do a self-referencing left join on the column which you wish to group by. This will add a new column to the original query containing a table in each row. Click the two arrows in the column header and choose "aggregate" to sum the amount for each of your groups.
Best regards,
Christian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@TristanKuesters What I would suggest easiest option would be is to go to power bi desktop query editor -> right click your original query and click Reference. This would create another query that is referenced original. Then for the second group do Group By via Transorm tab that will give you sum of Amount by Group. Close&Apply and then create relationship between two queries using Group column.
So you will end up with query that is grouped by sum of amount like how you wanted and you will also have original query that also contains order number column.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It works. Thanks a lot.
Sometime the solution is so simple.

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
03-01-2023 08:29 PM | |||
08-21-2024 06:40 AM | |||
03-14-2024 10:50 AM | |||
12-12-2023 08:28 AM | |||
Anonymous
| 08-30-2022 11:12 PM |
User | Count |
---|---|
141 | |
115 | |
84 | |
63 | |
48 |