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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Anonymous
Not applicable

Calculating sum-total of measure

 

Hello - I created tis kind of complicated measure to calculate "the Amout to meet goal" - 

AmtToMeetGoal = IF(HASONEFILTER('Sub List'[ContractNumber]),IF((Sumx(DISTINCT('Sub List'[ContractNumber]),(Maxx(Distinct('Sub List'[ContractNumber]),Max('Sub List'[GoalDollars])))))>[AmountB4SlicerPeriod], ((Sumx(DISTINCT('Sub List'[ContractNumber]),(Maxx(Distinct('Sub List'[ContractNumber]),Max('Sub List'[GoalDollars])))))-[AmountB4SlicerPeriod]),0))
 
But for some reason the total of this measure doesn't show up and when I tried to create multiple measures and combined them to one at the end - I get the wrong total, even though that the list of Amounts that are showing on table is correct. If I export data to excel and sum it up the amounts, I'll get the right number. But for some in Power BI, the total either wrong or it's not showing up.
 
TotalMeasure Erro.PNG
 

 

Could you please help me solve this problem, if it's possible - Thank you in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I did it!!! I used the SUMMARIZE function and that solve the problem !!

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

How about this measure:

AmtToMeetGoal =
VAR sum1 =
    IF (
        (
            SUMX (
                DISTINCT ( 'Sub List'[ContractNumber] ),
                (
                    MAXX (
                        DISTINCT ( 'Sub List'[ContractNumber] ),
                        MAX ( 'Sub List'[GoalDollars] )
                    )
                )
            )
        )
            > [AmountB4SlicerPeriod],
        (
            (
                SUMX (
                    DISTINCT ( 'Sub List'[ContractNumber] ),
                    (
                        MAXX (
                            DISTINCT ( 'Sub List'[ContractNumber] ),
                            MAX ( 'Sub List'[GoalDollars] )
                        )
                    )
                )
            )
                - [AmountB4SlicerPeriod]
        ),
        0
    )
RETURN
    IF (
        HASONEVALUE ( 'Sub List'[ContractNumber] ),
        Sum1,
        SUMX ( 'Sub List', sum1 )
    )

Best Regards

Maggie

 

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

I did it!!! I used the SUMMARIZE function and that solve the problem !!

Anonymous
Not applicable

It works but it gives me the wrong total :(. The amount that listed on column is correct but for some reason when it comes to total, it just doesn't sums it up right.

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.