Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Shadd307
Frequent Visitor

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_linkissue_keystory_pointsissue_type

GDES-1234

GDES-65471

story

GDES-1234GDES-789653story
GDES-987453GDES-41235story
GDES-987453GDES-63218task
GDES-987453GDES-579215spike
GDES-987453GDES-1679343story

 

 

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.

1 ACCEPTED SOLUTION
sevenhills
Super User
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/

 

View solution in original post

2 REPLIES 2
sevenhills
Super User
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/

 

That works great thanks for the quick response.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.