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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
krishna0
Helper II
Helper II

Problem with sum from calculated value

Hello, all!

 

I have pretty complex report based on DevOps and I am trying to get sum of weighted value for features based on user stories ended in particular period for a particular Team. Whole measure is here:

PercentMustUSClosed = 
    VAR _1 =
        MAX ( WorkItems[WorkItemId] )
    VAR _StartDate =
        CALCULATE (
            MAX ( IterationToDate[DateOnly] ),
            FILTER (
                ALL ( IterationToDate ),
                IterationToDate[CorrectStartIter] = SELECTEDVALUE ( IterDates[IterationLevel2] )
            )
        )
    VAR _ClosedDate =
        CALCULATE (
            MIN ( IterationToDate[DateOnly] ),
            FILTER (
                ALL ( IterationToDate ),
                IterationToDate[CorrectClosedIter]
                    = SELECTEDVALUE ( IterDates[IterationLevel2] )
            )
        )

    VAR _USClosed = 
    COALESCE (
            calculate(count(WorkItems[WorkItemId]),
                NOT ( ISBLANK ( FIND ( "must", LOWER ( WorkItems[ParentTag] ), 1, BLANK () ) ) ),
                FILTER (
                    ALL ( WorkItems ),
                    WorkItems[ParentWorkItemId] = _1
                        && WorkItems[State] = "Closed"
                        && WorkItems[State] <> "Removed"
                        && WorkItems[WorkItemType] = "User Story"
                        && WorkItems[StartDate] <= _StartDate
                        && IF (
                            ISBLANK ( WorkItems[ClosedDate] ),
                            1,
                            _ClosedDate <= WorkItems[ClosedDate]
                        )
                        && NOT ( ISBLANK ( WorkItems[ParentStartDateDay] ) )
                            && NOT ( ISBLANK ( WorkItems[ParentTag] ) )
                ),
                FILTER ( Areas, Areas[AreaLevel2] = "1 - DL DW" )
            ),
            0
        )
    VAR _USAll = 
    COALESCE (
            calculate(count(WorkItems[WorkItemId]),
                NOT ( ISBLANK ( FIND ( "must", LOWER ( WorkItems[ParentTag] ), 1, BLANK () ) ) ),
                FILTER (
                    ALL ( WorkItems ),
                    WorkItems[ParentWorkItemId] = _1
                        && WorkItems[State] <> "Removed"
                        && WorkItems[WorkItemType] = "User Story"
                        && WorkItems[StartDate] <= _StartDate
                        && IF (
                            ISBLANK ( WorkItems[ClosedDate] ),
                            1,
                            _ClosedDate <= WorkItems[ClosedDate]
                        )
                        && NOT ( ISBLANK ( WorkItems[ParentStartDateDay] ) )
                            && NOT ( ISBLANK ( WorkItems[ParentTag] ) )
                ),
                FILTER ( Areas, Areas[AreaLevel2] = "1 - DL DW" )
            ),
            0
        )
    VAR _Weight = DIVIDE ( _USClosed, _USAll, BLANK()) * 5
    RETURN
_Weight

 

It is long but the most important is just the last variable. It gives me desired values per row:

krishna0_0-1674412072772.png

But now I struggle to get simple sum of these values and work with them further. I tried to do it using SUMMARIZE(), but I might be lacking some knowledge how to wrap it up correctly. This measure is filtered by context (iteration path chosen) so what I want is just to take the sum that comes out from this measure.

 

Thanks in advance for any kind of advise.

 

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@krishna0 First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thank you for your input. This is not exactly the solution, because I wanted to show these values in a card. I just come up with other way of calculating the value I need and it does not require separate rows summary anymore. Thanks 🙂

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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