# Aggregating Costs per Sprint per Epic

Thanks to help on the forum I was able to calculate cost per story point. That was helpful, but as I started looking at the data I realized I would be skewed by having a default value per point. The goal is to understand the cost per JIRA epic. Epics are made up of stories that will have points, but not every point is the same as it is based on the team make-up and how big of a slice of that sprint did those points really acount for.

If I assume I have constant team size and can assume a proxy cost per team ~ 100,000 then I can use this formally to understand how much each point per sprint is worth.

Cost per Sprint Point
CASE WHEN [Measures].[Sprint Story Points completed] > 0 THEN
100000 / [Measures].[Sprint Story Points completed]
END

What I don’t know how to do is to leverage this calculation with and lookup each issue story point, determine the sprint and then create this calculation? Any ideas with the use case below.

For example

Sprint Sprint SP Completed Cost per SP
Sprint 1 40 \$2,500.00
Sprint 2 30 \$3,333.33
Sprint 3 70 \$1,428.57
Sprint 4 50 \$2,000.00
Sprint 5 20 \$5,000.00
Sprint 6 60 \$1,666.67
Sprint 7 80 \$1,250.00
Sprint 8 15 \$6,666.67
`````` Story  	SP   Completed Sprint	Calculated Cost
AA	         8	           	1		    \$20,000.00
BB          5	           	2	 	    \$16,666.67
CC	         8	           	3		    \$11,428.57
DD	         4	           	3	        \$5,714.29
EE	         12	           	5		    \$60,000.00
FF	         9	           	7		    \$11,250.00
``````

Total Cost \$125,059.52

Hi @GS_Steve,

You can access the value from Sprint on Issue level by using Tuple construction. The formula to get Calculated Cost would be as follows:

``````[Measures].[Sprint Story Points completed] *
(
[Measures].[Cost per SP],
[Issue].CurrentHierarchy.DefaultMember
)
``````

Here is an example of a report with Epic hierarchy added to rows:

Lauma / support@eazybi.com