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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
learner03
Post Partisan
Post Partisan

Filter based on Sum and hide rows

I have following table as a report that displays as below-

 

akapoor03_0-1670453982870.png

and have an item slicer as belowto select the item code-

akapoor03_1-1670454028589.png

 

I need to do the fuctionality as such that when the uder selects an item code or item codes then it should filter table based on the capacity hold of that item (to consolidate similar item in one location to free up other space). 

For example- if user select item ABC from item slicer, than the table should only show those items whose SUM is less than or equal to the the MAX capacity which is 128 in this case. So here it will show rows with Qty 47 & 48.

 

Similar functionality for other items.

 

1 ACCEPTED SOLUTION

Hi @learner03 ,

Here's my solution. Create a calculated column.

Flag =
VAR _Max =
    MAXX (
        FILTER ( 'Table', 'Table'[ItemCode] = EARLIER ( 'Table'[ItemCode] ) ),
        'Table'[Location Qty]
    )
VAR _Sum =
    SUMX (
        FILTER (
            'Table',
            'Table'[ItemCode] = EARLIER ( 'Table'[ItemCode] )
                && 'Table'[Location Qty] <= EARLIER ( 'Table'[Location Qty] )
        ),
        'Table'[Location Qty]
    )
RETURN
    IF ( _Sum <= _Max, 1, 0 )

Result:

vkalyjmsft_0-1670569534932.png

If you want to show the items in a visual, put the new column in visual filter and set to1, get the correct result:

vkalyjmsft_1-1670569572467.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @learner03 ,

Could you please explain why for the itemcode ABC, only 47 and 48 remained? The value 124 and 94 are also less than 128.

 

Best Regards,
Community Support Team _ kalyj

@v-yanjiang-msft because the capacity of the location is 128 and if 124 and 94 are added, it will be more than 128 which cannot be done.

Hi @learner03 ,

Here's my solution. Create a calculated column.

Flag =
VAR _Max =
    MAXX (
        FILTER ( 'Table', 'Table'[ItemCode] = EARLIER ( 'Table'[ItemCode] ) ),
        'Table'[Location Qty]
    )
VAR _Sum =
    SUMX (
        FILTER (
            'Table',
            'Table'[ItemCode] = EARLIER ( 'Table'[ItemCode] )
                && 'Table'[Location Qty] <= EARLIER ( 'Table'[Location Qty] )
        ),
        'Table'[Location Qty]
    )
RETURN
    IF ( _Sum <= _Max, 1, 0 )

Result:

vkalyjmsft_0-1670569534932.png

If you want to show the items in a visual, put the new column in visual filter and set to1, get the correct result:

vkalyjmsft_1-1670569572467.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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