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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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