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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Eckhardt_david
Frequent Visitor

SUMMARIZE not working as expected

Hi,

I'm trying to write a measure to calculate the total stored pallets on 1 warehouse location.

In below example, storage location 408874 has a total of 2 pallets stored.

The measure works fine when I only add field storage location to the Table visual.

But when adding additional fields (for example Load Number which is unique for each pallet), the measure is calculated on each line making the total pallets stored = 4, which is not correct.

My assumption was that by adding a SUMMARIZE function on Storage Location the table would show 1 line with value LOC EUEQ = 2 and the other line would be blank. But I geuss I'm doing something wrong here.

 

Thanks for your suggestions on how to fix this.

 

without Load Number:

without LOAD.PNG

with Load Number:

with LOAD.PNG

 

measure:

LOC EUEQ =
IF (
     ( [M_Unit Quantity - Inventory Details] <> BLANK () ),
    CALCULATE (
        IFERROR (
            SUMX (
                SUMMARIZE (
                    '02-D_OUT-INV_WAREHOUSE_LOCATIONS',
                    '02-D_OUT-INV_WAREHOUSE_LOCATIONS'[Storage Location],
                    "Count",
                        IF (
                            MAX ( '02-D_OUT-INV_WAREHOUSE_LOCATIONS'[USEFLG] ) = 1
                                || [M_Unit Quantity - Inventory Details] > 0,
                            1,
                            0
                        )
                            * IF ( MAX ( '02-D_OUT-INV_WAREHOUSE_LOCATIONS'[Location Length] ) > 125, 2, 1 )
                            * IF (
                                MAX ( '02-D_OUT-INV_WAREHOUSE_LOCATIONS'[Aisle Id] ) = "99"
                                    || MAX ( '02-D_OUT-INV_WAREHOUSE_LOCATIONS'[Aisle Id] ) = "98",
                                4 / 24,
                                4
                                    / ROUNDDOWN (
                                        4 * 80
                                            / MAX ( '02-D_OUT-INV_WAREHOUSE_LOCATIONS'[Location Width] ),
                                        0
                                    )
                            )
                ),
                [Count]
            ),
            0
        ),
        FILTER (
            '02-D_OUT-INV_WAREHOUSE_LOCATIONS',
            '02-D_OUT-INV_WAREHOUSE_LOCATIONS'[INSTANCE_ID] = "BEBORUL"
        )
    )
)

1 REPLY 1
AlB
Community Champion
Community Champion

Hi @Eckhardt_david 

I haven't looked in detail but try adding the new column in the visual to the SUMMARIZE as well:

SUMMARIZE (
                    '02-D_OUT-INV_WAREHOUSE_LOCATIONS',
                    '02-D_OUT-INV_WAREHOUSE_LOCATIONS'[Storage Location],

                    '02-D_OUT-INV_WAREHOUSE_LOCATIONS'[Load Number],

                    "Count",  

                     etc....

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.