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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Jeanxyz
Power Participant
Power Participant

need help with total calculation

I encounter difficulty with total calculation. I have a table where each Jira issue is assigned to a Team and a Sprint. Each sprint has a start date and end date. If an issue is solved before the sprint end date, the issue is considered completed on time. I need to add up the story points of all the issues solved on time. Below is the Dax measure I created:

For some reason the total line of story_points_completed(M) is not correct. I should have 407 points completed (i.e., sum of each spint line), but Power BI gives me 712.5 instead. 

Thanks for help!

 

*******************

story_points_completed(M) =
var amt=
Sumx(
values(dim_IssueSprints),
Calculate(sum(IssueSprints[story_points]),IssueSprints[Issue_Status_Cat]="Done",IssueSprints[Status_Change_Date]>=min(IssueSprints[Start_Date]),
IssueSprints[Status_Change_Date]<=max(IssueSprints[End_Date]))
)
return
if(amt=0,blank(),amt)
***************************
values() total.png
 
1 ACCEPTED SOLUTION
Jeanxyz
Power Participant
Power Participant

I finally got it right! Here is the correct formula and toal amount matches now. The previous measure didn't work because I thought by using values() , I created a virtual table which  is automatically linked to the fact table for filtering purpose. There is no relationship between the virtual table and fact table, so I need to quote the filter context explicitly in my filter condition. 

 

story_points_completed(M) =
var amt=
Sumx(
values(dim_IssueSprints),
Calculate(sum(IssueSprints[story_points]), filter(issuesprints,IssueSprints[Status_Change_Date]>=dim_IssueSprints[Start_Date] &&
IssueSprints[Status_Change_Date]<=dim_IssueSprints[End_Date] && IssueSprints[Sprint_Issue]=Dim_IssueSprints[Sprint_Issue] && IssueSprints[Issue_Status_Cat]="Done"))
)
return
if(amt=0,blank(),amt)

View solution in original post

5 REPLIES 5
Jeanxyz
Power Participant
Power Participant

I finally got it right! Here is the correct formula and toal amount matches now. The previous measure didn't work because I thought by using values() , I created a virtual table which  is automatically linked to the fact table for filtering purpose. There is no relationship between the virtual table and fact table, so I need to quote the filter context explicitly in my filter condition. 

 

story_points_completed(M) =
var amt=
Sumx(
values(dim_IssueSprints),
Calculate(sum(IssueSprints[story_points]), filter(issuesprints,IssueSprints[Status_Change_Date]>=dim_IssueSprints[Start_Date] &&
IssueSprints[Status_Change_Date]<=dim_IssueSprints[End_Date] && IssueSprints[Sprint_Issue]=Dim_IssueSprints[Sprint_Issue] && IssueSprints[Issue_Status_Cat]="Done"))
)
return
if(amt=0,blank(),amt)
Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

FreemanZ
Community Champion
Community Champion

hi @Jeanxyz 

try like:

story_points_completed(M) =
var amt=
Calculate(
    sum(IssueSprints[story_points]),
    IssueSprints[Issue_Status_Cat]="Done",
    IssueSprints[Status_Change_Date]
         >=min(IssueSprints[Start_Date]),
    IssueSprints[Status_Change_Date]
         <=max(IssueSprints[End_Date])
)
return
if(amt=0,blank(),amt)

This won't work because each sprint has its unique start date and end date. This needs to be taken into consideration. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.