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
aseel_abs
Regular Visitor

Help

Hello I need help in figuring out the following ;

I am working on a matrix visual that contains 3 rows and 1 value. 

 the first thing that I would like to do is to change my subtotal/total to sum up only "type of facility" that are = to Credits , Guarantees , total Amount given. 

However before adding those rows up, I would like change the "Total Amount Given". it has to be reduced by the projects that are assigned to it.

for example Bank code A the (total amount given) should be 500 - (60+50) - (66+22)= 302

so instead of showing 500 it should show 302 (which is basically the residual).

thus, the Bank Code A should equal to = 302$(residual) + 110$(P111) + 88$(P222)+70$(P333)= 570 $ (instead of $906)  

 

 

aseel_abs_0-1665054683587.png

 

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @aseel_abs ,

According to your description, here's my solution. Create a calculated column.

Column =
VAR _SUM =
    SUMX (
        FILTER (
            'Table',
            'Table'[BANK CODE] = EARLIER ( 'Table'[BANK CODE] )
                && 'Table'[TYPE OF FACILITY]
                    IN { "CREDITS", "GUARANTEES" }
                        && CONTAINSSTRING (
                            MAXX (
                                FILTER (
                                    'Table',
                                    'Table'[BANK CODE] = EARLIER ( 'Table'[BANK CODE] )
                                        && 'Table'[PROJECT CODE] = "-"
                                ),
                                'Table'[TYPE OF FACILITY]
                            ),
                            'Table'[PROJECT CODE]
                        )
        ),
        'Table'[LIMIT AMOUNT]
    )
RETURN
    IF (
        CONTAINSSTRING ( 'Table'[TYPE OF FACILITY], "TOTAL AMOUNT GIVEN" ),
        'Table'[LIMIT AMOUNT] - _SUM,
        IF (
            'Table'[TYPE OF FACILITY] IN { "CREDITS", "GUARANTEES" },
            'Table'[LIMIT AMOUNT]
        )
    )

Get the result.

vkalyjmsft_0-1665125052327.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

1 REPLY 1
v-yanjiang-msft
Community Support
Community Support

Hi @aseel_abs ,

According to your description, here's my solution. Create a calculated column.

Column =
VAR _SUM =
    SUMX (
        FILTER (
            'Table',
            'Table'[BANK CODE] = EARLIER ( 'Table'[BANK CODE] )
                && 'Table'[TYPE OF FACILITY]
                    IN { "CREDITS", "GUARANTEES" }
                        && CONTAINSSTRING (
                            MAXX (
                                FILTER (
                                    'Table',
                                    'Table'[BANK CODE] = EARLIER ( 'Table'[BANK CODE] )
                                        && 'Table'[PROJECT CODE] = "-"
                                ),
                                'Table'[TYPE OF FACILITY]
                            ),
                            'Table'[PROJECT CODE]
                        )
        ),
        'Table'[LIMIT AMOUNT]
    )
RETURN
    IF (
        CONTAINSSTRING ( 'Table'[TYPE OF FACILITY], "TOTAL AMOUNT GIVEN" ),
        'Table'[LIMIT AMOUNT] - _SUM,
        IF (
            'Table'[TYPE OF FACILITY] IN { "CREDITS", "GUARANTEES" },
            'Table'[LIMIT AMOUNT]
        )
    )

Get the result.

vkalyjmsft_0-1665125052327.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
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!

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