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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

line sum of line total doesn't match group total

Hi Guys

 

I need help with this strange behavior. I actually tried it also in excel and got same strange results, therefore i think it is more my not understanding basic algerbra than wrong calculation.

 

i have a table like this

 

countryytdly ytdly totalytd targettotal target
Austria      2,973.00      2,175.00      14,760.00      2,918.00      19,800.00
Germany    23,883.00    29,383.00    123,977.00    31,758.00    134,000.00
Switzerland      4,533.00      2,940.00        8,988.00      3,598.00      11,000.00
Total sum    31,389.00    34,498.00    147,725.00    38,274.00    164,800.00
Total calculated     31,389.00    34,498.00    147,725.00    38,485.00    164,800.00

 

where we have sales data ytd , ly ytd , ly total, ytd target and total target

the ytd target is calculated like ly ytd/ly total x total target. 

as you can see in the columns E5 and E6 i should get the same number. 

the E5 is calculated as sum of E2-4 and the E6 is calculated like C6/D6xF6

 

Is there a way how i can get to the same number. ?

hope you can help 

 

thank you 

 

m

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @Anonymous ,


This is a common measure total issue, when measure calculated on total level, it direct calculate with summarize total row contents instead of drill to bottom level and summary each row result.


You can try to use following formula to add a condition to check current level and write formula works with total level:

_ytd target =
IF (
    ISFILTERED ( Table4[country] ),
    SUM ( [ly ytd] ) / SUM ( [ly total] )
        * SUM ( [total target] ),
    SUMX (
        SUMMARIZE (
            Table4,
            [country],
            [ly ytd],
            Table4[ly total],
            Table4[total target],
            "YTD target", [ly ytd] / [ly total] * [total target]
        ),
        [YTD target]
    )
)

16.png

 

Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

HI @Anonymous ,


This is a common measure total issue, when measure calculated on total level, it direct calculate with summarize total row contents instead of drill to bottom level and summary each row result.


You can try to use following formula to add a condition to check current level and write formula works with total level:

_ytd target =
IF (
    ISFILTERED ( Table4[country] ),
    SUM ( [ly ytd] ) / SUM ( [ly total] )
        * SUM ( [total target] ),
    SUMX (
        SUMMARIZE (
            Table4,
            [country],
            [ly ytd],
            Table4[ly total],
            Table4[total target],
            "YTD target", [ly ytd] / [ly total] * [total target]
        ),
        [YTD target]
    )
)

16.png

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors