Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I am having a Table called Sprint_Master. I am trying to calculate
| ISSUE_KEY | SPRINT_NAME | SPRINT_REPORT_STATUS | IS_ADDED_DURING_SPRINT | STORY_POINTS_COMMITTED | STORY_POINTS_EXTRA_PULLED | ISSUE_TYPE_NAME | ISSUE_STATUS_NAME |
| ABC-52997 | Sprint 168 | INCOMPLETED | FALSE | 4 | 0 | Story | Closed |
| ABC-52997 | Sprint 169 | INCOMPLETED | FALSE | 5 | 0 | Story | Closed |
| ABC-53831 | Sprint 169 | COMPLETED | TRUE | 0 | 1 | Story | Closed |
| ABC-53939 | Sprint 169 | INCOMPLETED | TRUE | 0 | null | Story | Resolved |
| ABC-52997 | Sprint 170 | COMPLETED | FALSE | 5 | 0 | Story | Closed |
| ABC-53395 | Sprint 170 | REMOVED | FALSE | 1 | 0 | Story | Closed |
| ABC-53830 | Sprint 170 | INCOMPLETED | FALSE | null | 0 | Story | Closed |
| ABC-53939 | Sprint 170 | INCOMPLETED | FALSE | null | 0 | Story | Resolved |
| ABC-53395 | Sprint 171 | INCOMPLETED | FALSE | 1 | 0 | Story | Closed |
| ABC-53830 | Sprint 171 | INCOMPLETED | FALSE | null | 0 | Story | Closed |
| ABC-53939 | Sprint 171 | REMOVED | FALSE | null | 0 | Story | Resolved |
| ABC-54687 | Sprint 171 | REMOVED | FALSE | 3 | 0 | Story | Closed |
| ABC-54688 | Sprint 171 | INCOMPLETED | FALSE | 2 | 0 | Story | Closed |
| ABC-54689 | Sprint 171 | INCOMPLETED | FALSE | 2 | 0 | Story | Closed |
| ABC-54963 | Sprint 171 | INCOMPLETED | TRUE | 0 | null | Story | Resolved |
| ABC-55020 | Sprint 171 | REMOVED | TRUE | 0 | 1 | Internal Bug | Closed |
| ABC-53395 | Sprint 172 | COMPLETED | FALSE | 1 | 0 | Story | Closed |
| ABC-53830 | Sprint 172 | INCOMPLETED | FALSE | null | 0 | Story | Closed |
| ABC-54687 | Sprint 172 | REMOVED | FALSE | 3 | 0 | Story | Closed |
| ABC-54688 | Sprint 172 | INCOMPLETED | FALSE | 2 | 0 | Story | Closed |
| ABC-54689 | Sprint 172 | INCOMPLETED | FALSE | 2 | 0 | Story | Closed |
| ABC-54963 | Sprint 172 | INCOMPLETED | FALSE | null | 0 | Story | Resolved |
| ABC-55019 | Sprint 172 | INCOMPLETED | FALSE | 1 | 0 | Story | Closed |
| ABC-53830 | Sprint 173 | INCOMPLETED | FALSE | null | 0 | Story | Closed |
| ABC-54687 | Sprint 173 | INCOMPLETED | FALSE | 3 | 0 | Story | Closed |
| ABC-54688 | Sprint 173 | INCOMPLETED | FALSE | 2 | 0 | Story | Closed |
| ABC-54689 | Sprint 173 | REMOVED | FALSE | 2 | 0 | Story | Closed |
| ABC-54963 | Sprint 173 | REMOVED | FALSE | null | 0 | Story | Resolved |
| ABC-55019 | Sprint 173 | INCOMPLETED | FALSE | 1 | 0 | Story | Closed |
| ABC-53830 | Sprint 174 | INCOMPLETED | FALSE | null | 0 | Story | Closed |
| ABC-54687 | Sprint 174 | INCOMPLETED | FALSE | 3 | 0 | Story | Closed |
| ABC-54688 | Sprint 174 | INCOMPLETED | FALSE | 2 | 0 | Story | Closed |
| ABC-55019 | Sprint 174 | INCOMPLETED | FALSE | 1 | 0 | Story | Closed |
| ABC-55649 | Sprint 174 | REMOVED | FALSE | 5 | 0 | Story | Open |
| ABC-56217 | Sprint 174 | INCOMPLETED | FALSE | null | 0 | Story | Resolved |
| ABC-53830 | Sprint 175 | REMOVED | FALSE | null | 0 | Story | Closed |
| ABC-54687 | Sprint 175 | INCOMPLETED | FALSE | 3 | 0 | Story | Closed |
| ABC-54688 | Sprint 175 | COMPLETED | FALSE | 2 | 0 | Story | Closed |
| ABC-55019 | Sprint 175 | COMPLETED | FALSE | 1 | 0 | Story | Closed |
| ABC-55994 | Sprint 175 | INCOMPLETED | FALSE | 3 | 0 | Story | Closed |
| ABC-56217 | Sprint 175 | INCOMPLETED | FALSE | null | 0 | Story | Resolved |
| ABC-56585 | Sprint 175 | INCOMPLETED | FALSE | null | 0 | Story | Closed |
| ABC-53947 | Sprint 194 | INCOMPLETED | TRUE | 0 | null | Task | Waiting |
| ABC-56488 | Sprint 194 | REMOVED | TRUE | 0 | null | Internal Bug | Closed |
| ABC-62329 | Sprint 194 | COMPLETED | FALSE | 3 | 0 | Story | Closed |
| ABC-63316 | Sprint 194 | COMPLETED | TRUE | 0 | null | Internal Bug | Closed |
| ABC-64478 | Sprint 194 | COMPLETED | TRUE | 0 | null | Internal Bug | Closed |
| ABC-53947 | Sprint 195 | REMOVED | FALSE | null | 0 | Task | Waiting |
| ABC-59548 | Sprint 195 | COMPLETED | TRUE | 0 | null | Internal Bug | Closed |
| ABC-54244 | Sprint 201 | INCOMPLETED | TRUE | 0 | null | Internal Bug | Closed |
| ABC-54244 | Sprint 202 | COMPLETED | FALSE | null | 0 | Internal Bug | Closed |
| ABC-54687 | Sprint 176 | COMPLETED | FALSE | 3 | 0 | Story | Closed |
| ABC-55994 | Sprint 176 | INCOMPLETED | FALSE | 3 | 0 | Story | Closed |
| ABC-56217 | Sprint 176 | REMOVED | FALSE | null | 0 | Story | Resolved |
| ABC-56408 | Sprint 176 | INCOMPLETED | FALSE | 2 | 0 | Story | Closed |
| ABC-56584 | Sprint 176 | INCOMPLETED | FALSE | 3 | 0 | Story | Closed |
| ABC-56585 | Sprint 176 | REMOVED | FALSE | null | 0 | Story | Closed |
| ABC-55994 | Sprint 177 | INCOMPLETED | FALSE | 3 | 0 | Story | Closed |
| ABC-56408 | Sprint 177 | INCOMPLETED | FALSE | 2 | 0 | Story | Closed |
| ABC-56409 | Sprint 177 | INCOMPLETED | FALSE | 1 | 0 | Story | Closed |
| ABC-56584 | Sprint 177 | INCOMPLETED | FALSE | 3 | 0 | Story | Closed |
| ABC-57359 | Sprint 177 | INCOMPLETED | FALSE | 2 | 0 | Story | Closed |
| ABC-57545 | Sprint 177 | INCOMPLETED | FALSE | 3 | 0 | Story | Closed |
| ABC-55994 | Sprint 178 | INCOMPLETED | FALSE | 3 | 0 | Story | Closed |
| ABC-56408 | Sprint 178 | COMPLETED | FALSE | 2 | 0 | Story | Closed |
| ABC-56409 | Sprint 178 | INCOMPLETED | FALSE | 2 | 0 | Story | Closed |
| ABC-56410 | Sprint 178 | INCOMPLETED | TRUE | 0 | 2 | Story | Closed |
| ABC-56584 | Sprint 178 | COMPLETED | FALSE | 3 | 0 | Story | Closed |
| ABC-56585 | Sprint 178 | INCOMPLETED | TRUE | 0 | null | Story | Closed |
| ABC-57359 | Sprint 178 | COMPLETED | FALSE | 2 | 0 | Story | Closed |
| ABC-57463 | Sprint 178 | INCOMPLETED | TRUE | 0 | 3 | Story | Closed |
| ABC-57545 | Sprint 178 | INCOMPLETED | FALSE | 3 | 0 | Story | Closed |
Solved! Go to Solution.
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.
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.
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!
Thank you
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!
Best Regards,
Jing
Thank you for looking into.
Ideally the last one should be considered.
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.
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.
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!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 17 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |