Forum Discussion
bullius
Helper V
10 years agoTable with SUM values
Hi
I want to produce a table with SUM values. My data looks something like this:
Current data:
| Code | Year | Type | Amount |
| A | 2013 | Type 1 | 10 |
| A | 2013 | Type 1 | 20 |
| A | 2013 | Type 2 | 1 |
| A | 2013 | Type 2 | 2 |
| A | 2014 | Type 1 | 40 |
| A | 2014 | Type 2 | 4 |
| A | 2015 | Type 1 | 35 |
| A | 2015 | Type 2 | 3 |
| B | 2014 | Type 1 | 5 |
| B | 2014 | Type 1 | 10 |
| B | 2014 | Type 1 | 20 |
| B | 2014 | Type 2 | 100 |
| B | 2014 | Type 2 | 200 |
| B | 2014 | Type 2 | 150 |
| B | 2015 | Type 1 | 50 |
| B | 2015 | Type 2 | 300 |
Table I want to produce:
| Code | Year | Type 1 Sum |
| A | 2013 | 30 |
| A | 2014 | 40 |
| A | 2015 | 35 |
| B | 2014 | 35 |
| B | 2015 | 50 |
As you can see, I want the sum of [Amount] filtered by [Type], grouped by [Code] and [Year].
I have tried a few different formulas, but can't get anything to work.
Any help appreciated!
bullius Go to power bi desktop query editor, under Transform tab click Group by and apply it as shown below.
2 Replies
- ankitpatira
Community Champion
bullius Go to power bi desktop query editor, under Transform tab click Group by and apply it as shown below.
- bullius
Helper V
That works, thanks!