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

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.

Reply
BAUTNIDE
Regular Visitor

Add calculated row values ​​as a total

Hello dear Power BI community,

 

I have the following problem: I have calculated a number of boxes that need to be refilled for a process if the net required quantity is greater than 0. The calculation also works correctly in the table that is output.

 

I also want to add the individual results for each calculated row to a total value. Unfortunately, an incorrect result is sometimes displayed here (see screenshot), because the system in my formula always calculates with the maximum value of the quantity per box, which is different for each row.

 

Does anyone have an idea how I can get the individual intermediate results displayed correctly as a total?

 

BAUTNIDE_1-1721979596244.png

Code of the measure:

 

BedarfKLTs = 
IFERROR(
    IF([Nettobedarf Nachschub] / MAX('Zusammenführen1'[tbl_PACKSPEC.Menge]) <= 0, 
        0, 
    ROUNDUP([Nettobedarf Nachschub] / MAX('Zusammenführen1'[tbl_PACKSPEC.Menge]),0)),
0)

 

 

Thanks in advance

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@BAUTNIDE , Try updated measure instead of MAX using SUMX

 

DAX
BedarfKLTs =
SUMX(
'Zusammenführen1',
IFERROR(
IF(
'Zusammenführen1'[Nettobedarf Nachschub] / 'Zusammenführen1'[tbl_PACKSPEC.Menge] <= 0,
0,
ROUNDUP('Zusammenführen1'[Nettobedarf Nachschub] / 'Zusammenführen1'[tbl_PACKSPEC.Menge], 0)
),
0
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

3 REPLIES 3
BAUTNIDE
Regular Visitor

Sorry, but it still doesn't work as intended. 😒 I just can't get it to add up correctly. Currently, the formula that comes closest to the result is as follows:

BedarfKLTs = 
    IFERROR(
        ROUNDUP([Nettobedarf Nachschub] / MAX('Zusammenführen1'[tbl_PACKSPEC.Menge]),0), 
    0)

 

The following formula is far from the result:

BedarfKLTB001 = 
    SUMX(
        'Zusammenführen1',
    IFERROR(
        IF(
            DIVIDE([Nettobedarf Nachschub], MAX('Zusammenführen1'[tbl_PACKSPEC.Menge])) <= 0,
                0,
        ROUNDUP(DIVIDE([Nettobedarf Nachschub], MAX('Zusammenführen1'[tbl_PACKSPEC.Menge])), 0)
            ),
                0
            )
    )

 

Here the current situation:

BAUTNIDE_0-1722034245329.png

The formula behind "Nettobedarf Nachschub" and "BedarfKLTs" are measures and not part of a table.

 

Any idea, how I get the correct result?

BAUTNIDE
Regular Visitor

Wow, I´m very impressed 😀

It seems, that it´s working 👍

Thanks for the very quick reply

bhanu_gautam
Super User
Super User

@BAUTNIDE , Try updated measure instead of MAX using SUMX

 

DAX
BedarfKLTs =
SUMX(
'Zusammenführen1',
IFERROR(
IF(
'Zusammenführen1'[Nettobedarf Nachschub] / 'Zusammenführen1'[tbl_PACKSPEC.Menge] <= 0,
0,
ROUNDUP('Zusammenführen1'[Nettobedarf Nachschub] / 'Zusammenführen1'[tbl_PACKSPEC.Menge], 0)
),
0
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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 Kudoed Authors