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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JeevanMallya
Resolver II
Resolver II

Need Unique Story points to be calculated for TOTAL_STORY_POINTS_COMITTED

I am having a Table called Sprint_Master. I am trying to calculate

TOTAL_STORY_POINTS_COMITTED = Sum(Sprint_Master[STORY_POINTS_COMMITTED])+SUM(Sprint_Master[STORY_POINTS_EXTRA_PULLED]).
There are couple of Stories / Tasks / Defects with Story Points that are not completed in one sprint and gets moved to multipl sprints.In that case if i use the above query it is inaccurate since stories / Tasks / Defects with story points gets added multiple times resulting in TOTAL_STORY_POINTS_COMITTED inaccurate.
I would like to consider this once.
Table is added below.
 
ISSUE_KEYSPRINT_NAMESPRINT_REPORT_STATUSIS_ADDED_DURING_SPRINTSTORY_POINTS_COMMITTEDSTORY_POINTS_EXTRA_PULLEDISSUE_TYPE_NAMEISSUE_STATUS_NAME
ABC-52997Sprint 168INCOMPLETEDFALSE40StoryClosed
ABC-52997Sprint 169INCOMPLETEDFALSE50StoryClosed
ABC-53831Sprint 169COMPLETEDTRUE01StoryClosed
ABC-53939Sprint 169INCOMPLETEDTRUE0nullStoryResolved
ABC-52997Sprint 170COMPLETEDFALSE50StoryClosed
ABC-53395Sprint 170REMOVEDFALSE10StoryClosed
ABC-53830Sprint 170INCOMPLETEDFALSEnull0StoryClosed
ABC-53939Sprint 170INCOMPLETEDFALSEnull0StoryResolved
ABC-53395Sprint 171INCOMPLETEDFALSE10StoryClosed
ABC-53830Sprint 171INCOMPLETEDFALSEnull0StoryClosed
ABC-53939Sprint 171REMOVEDFALSEnull0StoryResolved
ABC-54687Sprint 171REMOVEDFALSE30StoryClosed
ABC-54688Sprint 171INCOMPLETEDFALSE20StoryClosed
ABC-54689Sprint 171INCOMPLETEDFALSE20StoryClosed
ABC-54963Sprint 171INCOMPLETEDTRUE0nullStoryResolved
ABC-55020Sprint 171REMOVEDTRUE01Internal BugClosed
ABC-53395Sprint 172COMPLETEDFALSE10StoryClosed
ABC-53830Sprint 172INCOMPLETEDFALSEnull0StoryClosed
ABC-54687Sprint 172REMOVEDFALSE30StoryClosed
ABC-54688Sprint 172INCOMPLETEDFALSE20StoryClosed
ABC-54689Sprint 172INCOMPLETEDFALSE20StoryClosed
ABC-54963Sprint 172INCOMPLETEDFALSEnull0StoryResolved
ABC-55019Sprint 172INCOMPLETEDFALSE10StoryClosed
ABC-53830Sprint 173INCOMPLETEDFALSEnull0StoryClosed
ABC-54687Sprint 173INCOMPLETEDFALSE30StoryClosed
ABC-54688Sprint 173INCOMPLETEDFALSE20StoryClosed
ABC-54689Sprint 173REMOVEDFALSE20StoryClosed
ABC-54963Sprint 173REMOVEDFALSEnull0StoryResolved
ABC-55019Sprint 173INCOMPLETEDFALSE10StoryClosed
ABC-53830Sprint 174INCOMPLETEDFALSEnull0StoryClosed
ABC-54687Sprint 174INCOMPLETEDFALSE30StoryClosed
ABC-54688Sprint 174INCOMPLETEDFALSE20StoryClosed
ABC-55019Sprint 174INCOMPLETEDFALSE10StoryClosed
ABC-55649Sprint 174REMOVEDFALSE50StoryOpen
ABC-56217Sprint 174INCOMPLETEDFALSEnull0StoryResolved
ABC-53830Sprint 175REMOVEDFALSEnull0StoryClosed
ABC-54687Sprint 175INCOMPLETEDFALSE30StoryClosed
ABC-54688Sprint 175COMPLETEDFALSE20StoryClosed
ABC-55019Sprint 175COMPLETEDFALSE10StoryClosed
ABC-55994Sprint 175INCOMPLETEDFALSE30StoryClosed
ABC-56217Sprint 175INCOMPLETEDFALSEnull0StoryResolved
ABC-56585Sprint 175INCOMPLETEDFALSEnull0StoryClosed
ABC-53947Sprint 194INCOMPLETEDTRUE0nullTaskWaiting
ABC-56488Sprint 194REMOVEDTRUE0nullInternal BugClosed
ABC-62329Sprint 194COMPLETEDFALSE30StoryClosed
ABC-63316Sprint 194COMPLETEDTRUE0nullInternal BugClosed
ABC-64478Sprint 194COMPLETEDTRUE0nullInternal BugClosed
ABC-53947Sprint 195REMOVEDFALSEnull0TaskWaiting
ABC-59548Sprint 195COMPLETEDTRUE0nullInternal BugClosed
ABC-54244Sprint 201INCOMPLETEDTRUE0nullInternal BugClosed
ABC-54244Sprint 202COMPLETEDFALSEnull0Internal BugClosed
ABC-54687Sprint 176COMPLETEDFALSE30StoryClosed
ABC-55994Sprint 176INCOMPLETEDFALSE30StoryClosed
ABC-56217Sprint 176REMOVEDFALSEnull0StoryResolved
ABC-56408Sprint 176INCOMPLETEDFALSE20StoryClosed
ABC-56584Sprint 176INCOMPLETEDFALSE30StoryClosed
ABC-56585Sprint 176REMOVEDFALSEnull0StoryClosed
ABC-55994Sprint 177INCOMPLETEDFALSE30StoryClosed
ABC-56408Sprint 177INCOMPLETEDFALSE20StoryClosed
ABC-56409Sprint 177INCOMPLETEDFALSE10StoryClosed
ABC-56584Sprint 177INCOMPLETEDFALSE30StoryClosed
ABC-57359Sprint 177INCOMPLETEDFALSE20StoryClosed
ABC-57545Sprint 177INCOMPLETEDFALSE30StoryClosed
ABC-55994Sprint 178INCOMPLETEDFALSE30StoryClosed
ABC-56408Sprint 178COMPLETEDFALSE20StoryClosed
ABC-56409Sprint 178INCOMPLETEDFALSE20StoryClosed
ABC-56410Sprint 178INCOMPLETEDTRUE02StoryClosed
ABC-56584Sprint 178COMPLETEDFALSE30StoryClosed
ABC-56585Sprint 178INCOMPLETEDTRUE0nullStoryClosed
ABC-57359Sprint 178COMPLETEDFALSE20StoryClosed
ABC-57463Sprint 178INCOMPLETEDTRUE03StoryClosed
ABC-57545Sprint 178INCOMPLETEDFALSE30StoryClosed
2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @JeevanMallya 

 

If you are happy to transform the table, you can first group by ISSUE_KEY column and have all rows into a column. Like below, each table on a row has all rows related to that issue. 

vjingzhanmsft_0-1721814025187.png

Then add a custom step to transform that "All Data" column and make it only remains the last sprint row. Finally expand the table column. As a result, only the last sprint record of each issue is left in the table. 

vjingzhanmsft_1-1721814318241.png

Here is the full code you can paste into a blank query's Advanced Editor to check the steps. 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("rZhNS8NAEIb/ivSskP1M9mhrBEGt1KoH8VCwSDGk0lbBf28EwWQ2s7Oz3UMJhfLwfsxst31+npxPZ2dGOldOTif3H7tNezgRtureXN3O5jd31/WyvujeXZ5f39fdU3ev4vejh+3uu3vOmu1+/Tp5OUVIDiUZgqQqJSCpz1kuHuo/hAhhnHJhQT1Q+9k0PdZivd82XwF7ZQFERZtTzkDOor6ZPw4ogo6ogJTxsP+MBWHDoHgwPynoUKA4rkuclOBSjAYf5VDbqqRRihDUUao4d5ImedYSSc6qMImzM6aQXn//OYE1vmoP6127ak6mn28ReyOR/ePOlDxmpuAgyCyDgEviDsIRJDAIrJjGJkFECuP2p3L2h8O4HeIkbodqdKa4/Y1TkrrDrXG70zm7w2Hc7nASlTqMCidRURmrPZLfH7xszD/W7T/DShGZUNz3OmjPxI4U1ZzJ1twvKUdvGIdszTmdxxnsDidFdWdNZZJx/k1K97U5f678S8JytX/vHk+rzWHTvvWE6UGDbjjnPid8S7BSSQdxCfFbpYQNcdjCtC49n8cAvRLIbcQacEZXEHSUMi11bwlkEXOHZCKxy1/PLkUEZ5BNGxRv4222jbexx+vItuuiihNFHYzduZHLHjiBou1RiZfpkkBMOImMSRcujkR9g8DA092VykRqotyVRps8mmB3+L9N3O4qZH+5zeGKaJIowqTesScZI4BZ425cUBD4LU8NU2rcpR7+LAlqUoyZ5E/Syw8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ISSUE_KEY = _t, SPRINT_NAME = _t, SPRINT_REPORT_STATUS = _t, IS_ADDED_DURING_SPRINT = _t, STORY_POINTS_COMMITTED = _t, STORY_POINTS_EXTRA_PULLED = _t, ISSUE_TYPE_NAME = _t, ISSUE_STATUS_NAME = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ISSUE_KEY", type text}, {"SPRINT_NAME", type text}, {"SPRINT_REPORT_STATUS", type text}, {"IS_ADDED_DURING_SPRINT", type logical}, {"STORY_POINTS_COMMITTED", Int64.Type}, {"STORY_POINTS_EXTRA_PULLED", Int64.Type}, {"ISSUE_TYPE_NAME", type text}, {"ISSUE_STATUS_NAME", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"ISSUE_KEY"}, {{"All Data", each _, type table [ISSUE_KEY=nullable text, SPRINT_NAME=nullable text, SPRINT_REPORT_STATUS=nullable text, IS_ADDED_DURING_SPRINT=nullable logical, STORY_POINTS_COMMITTED=nullable number, STORY_POINTS_EXTRA_PULLED=nullable number, ISSUE_TYPE_NAME=nullable text, ISSUE_STATUS_NAME=nullable text]}}),
    Custom1 = Table.TransformColumns(#"Grouped Rows",{"All Data", each Table.FirstN(Table.Sort(_, {"SPRINT_NAME", Order.Descending}),1)}),
    #"Expanded All Data" = Table.ExpandTableColumn(Custom1, "All Data", {"SPRINT_NAME", "SPRINT_REPORT_STATUS", "IS_ADDED_DURING_SPRINT", "STORY_POINTS_COMMITTED", "STORY_POINTS_EXTRA_PULLED", "ISSUE_TYPE_NAME", "ISSUE_STATUS_NAME"}, {"SPRINT_NAME", "SPRINT_REPORT_STATUS", "IS_ADDED_DURING_SPRINT", "STORY_POINTS_COMMITTED", "STORY_POINTS_EXTRA_PULLED", "ISSUE_TYPE_NAME", "ISSUE_STATUS_NAME"})
in
    #"Expanded All Data"

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

View solution in original post

JeevanMallya
Resolver II
Resolver II

4 REPLIES 4
JeevanMallya
Resolver II
Resolver II

Thank you

Anonymous
Not applicable

Hi @JeevanMallya 

 

I have one question: for an issue that might appear multiple times in different sprints, the score of which sprint is you want to sum up? For example, Issue ABC-52997 appears three times (sprint 168, 169, 170) in your sample data, and the story points in different sprints are different (4 and 5). Which sprint do you hope to include in the TOTAL_STORY_POINTS_COMITTED? The first one or the last one? Or the one with a specified status? Please provide some expected outcome based on your sample data. Thanks!

vjingzhanmsft_0-1721784820449.png

 

Best Regards,
Jing

 

Thank you for looking into.

Ideally the last one should be considered.

Anonymous
Not applicable

Hi @JeevanMallya 

 

If you are happy to transform the table, you can first group by ISSUE_KEY column and have all rows into a column. Like below, each table on a row has all rows related to that issue. 

vjingzhanmsft_0-1721814025187.png

Then add a custom step to transform that "All Data" column and make it only remains the last sprint row. Finally expand the table column. As a result, only the last sprint record of each issue is left in the table. 

vjingzhanmsft_1-1721814318241.png

Here is the full code you can paste into a blank query's Advanced Editor to check the steps. 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("rZhNS8NAEIb/ivSskP1M9mhrBEGt1KoH8VCwSDGk0lbBf28EwWQ2s7Oz3UMJhfLwfsxst31+npxPZ2dGOldOTif3H7tNezgRtureXN3O5jd31/WyvujeXZ5f39fdU3ev4vejh+3uu3vOmu1+/Tp5OUVIDiUZgqQqJSCpz1kuHuo/hAhhnHJhQT1Q+9k0PdZivd82XwF7ZQFERZtTzkDOor6ZPw4ogo6ogJTxsP+MBWHDoHgwPynoUKA4rkuclOBSjAYf5VDbqqRRihDUUao4d5ImedYSSc6qMImzM6aQXn//OYE1vmoP6127ak6mn28ReyOR/ePOlDxmpuAgyCyDgEviDsIRJDAIrJjGJkFECuP2p3L2h8O4HeIkbodqdKa4/Y1TkrrDrXG70zm7w2Hc7nASlTqMCidRURmrPZLfH7xszD/W7T/DShGZUNz3OmjPxI4U1ZzJ1twvKUdvGIdszTmdxxnsDidFdWdNZZJx/k1K97U5f678S8JytX/vHk+rzWHTvvWE6UGDbjjnPid8S7BSSQdxCfFbpYQNcdjCtC49n8cAvRLIbcQacEZXEHSUMi11bwlkEXOHZCKxy1/PLkUEZ5BNGxRv4222jbexx+vItuuiihNFHYzduZHLHjiBou1RiZfpkkBMOImMSRcujkR9g8DA092VykRqotyVRps8mmB3+L9N3O4qZH+5zeGKaJIowqTesScZI4BZ425cUBD4LU8NU2rcpR7+LAlqUoyZ5E/Syw8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ISSUE_KEY = _t, SPRINT_NAME = _t, SPRINT_REPORT_STATUS = _t, IS_ADDED_DURING_SPRINT = _t, STORY_POINTS_COMMITTED = _t, STORY_POINTS_EXTRA_PULLED = _t, ISSUE_TYPE_NAME = _t, ISSUE_STATUS_NAME = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ISSUE_KEY", type text}, {"SPRINT_NAME", type text}, {"SPRINT_REPORT_STATUS", type text}, {"IS_ADDED_DURING_SPRINT", type logical}, {"STORY_POINTS_COMMITTED", Int64.Type}, {"STORY_POINTS_EXTRA_PULLED", Int64.Type}, {"ISSUE_TYPE_NAME", type text}, {"ISSUE_STATUS_NAME", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"ISSUE_KEY"}, {{"All Data", each _, type table [ISSUE_KEY=nullable text, SPRINT_NAME=nullable text, SPRINT_REPORT_STATUS=nullable text, IS_ADDED_DURING_SPRINT=nullable logical, STORY_POINTS_COMMITTED=nullable number, STORY_POINTS_EXTRA_PULLED=nullable number, ISSUE_TYPE_NAME=nullable text, ISSUE_STATUS_NAME=nullable text]}}),
    Custom1 = Table.TransformColumns(#"Grouped Rows",{"All Data", each Table.FirstN(Table.Sort(_, {"SPRINT_NAME", Order.Descending}),1)}),
    #"Expanded All Data" = Table.ExpandTableColumn(Custom1, "All Data", {"SPRINT_NAME", "SPRINT_REPORT_STATUS", "IS_ADDED_DURING_SPRINT", "STORY_POINTS_COMMITTED", "STORY_POINTS_EXTRA_PULLED", "ISSUE_TYPE_NAME", "ISSUE_STATUS_NAME"}, {"SPRINT_NAME", "SPRINT_REPORT_STATUS", "IS_ADDED_DURING_SPRINT", "STORY_POINTS_COMMITTED", "STORY_POINTS_EXTRA_PULLED", "ISSUE_TYPE_NAME", "ISSUE_STATUS_NAME"})
in
    #"Expanded All Data"

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.