Forum Discussion
Sum values from 1 column based on a value in a second column
Total newbie here so please forgive me if this seems really simple.
I am using Jira data loaded into Power BI and I am trying to calculate the total number of story points for issues that are a child of an epic, using this total to give me Epic total Storyt Point invested.
Here is an example of the data I think I need to use I have pretty much every field in Jira loaded and feeding my reports through a dataflow
| epic_link | issue_key | story_points | issue_type |
GDES-1234 | GDES-6547 | 1 | story |
| GDES-1234 | GDES-78965 | 3 | story |
| GDES-987453 | GDES-4123 | 5 | story |
| GDES-987453 | GDES-6321 | 8 | task |
| GDES-987453 | GDES-57921 | 5 | spike |
| GDES-987453 | GDES-167934 | 3 | story |
So for GDES-1234 I would get a total Epic Story Point Velue = 4
and GDES-987453 I would get a total of 21
I am just at a loss on how to move forward.
Measure:
story_points total for epic_link = IF( HASONEVALUE('Table (2)'[epic_link]), CALCULATE( SUM('Table (2)'[story_points]), filter( allselected('Table (2)'), 'Table (2)'[epic_link] = SELECTEDVALUE('Table (2)'[epic_link]) ) ), SUM('Table (2)'[story_points]) )You can use all('Table (2)') or allselected('Table (2)') per your needs ...
https://mitchellpearson.com/2020/09/14/understanding-row-context-in-dax-and-power-bi/
2 Replies
- sevenhills
Super User
Measure:
story_points total for epic_link = IF( HASONEVALUE('Table (2)'[epic_link]), CALCULATE( SUM('Table (2)'[story_points]), filter( allselected('Table (2)'), 'Table (2)'[epic_link] = SELECTEDVALUE('Table (2)'[epic_link]) ) ), SUM('Table (2)'[story_points]) )You can use all('Table (2)') or allselected('Table (2)') per your needs ...
https://mitchellpearson.com/2020/09/14/understanding-row-context-in-dax-and-power-bi/
- Shadd307Frequent Visitor
That works great thanks for the quick response.