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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
ngocnguyen
Helper IV
Helper IV

Subtotal sum

Hi,

Hi

I have somes measure to get result of factors: A,B,C,D,Cost

Logic for  :" Cost (exclude factor) = Cost - remaining factors 
Now I wanna create a matrix that like below 

table1.PNG

{ Cost ( exclude factor) = Cost - (A+B+C+D) = 104-(10+34+22+23) = 25}

 

in case If I remove some factors (A,B,C,D), the matrix will auto calculate " Cost (Exclude factor)". 
For example:

 

table2.PNG
{ Cost ( exclude factor) = Cost - (A+C+D) = 104-(10+22+23) = 25}

Is there anyway to do it in PBI ?, by creating measure?

 

 

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please try to write a measure something like below.

 

Expected measure: =
SWITCH (
    SELECTEDVALUE ( 'tablename'[Factor] ),
    "Cost(exclude factor)"
        = CALCULATE (
            SUM ( 'tablename'[Amt] ),
            FILTER ( ALLSELECTED ( 'tablename' ), 'tablename'[Factor] = "Cost" )
        )
            - CALCULATE (
                SUM ( 'tablename'[Amt] ),
                FILTER ( ALLSELECTED ( 'tablename' ), 'tablename'[Factor] <> "Cost" )
            ), SUM ( 'tablename'[Amt] )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Hi @Jihwan_Kim 

Thanks for  your help

However, My issue is that, each reasult in column "Amt" in matrix are Measure
For example:

A= [A],  B = [B], C =[C], Cost =[Cost]
So logic for Cost (exclude factor) = Cost - remaining factors 
Then to issue the matrix I create a measure like:

Amt = 

SWITCH( TRUE(),
SELECTEDVALUE(table[Factor])= "A",[A],
SELECTEDVALUE(table[Factor])= "B",[B],
SELECTEDVALUE(table[Factor])= "C",[C],
SELECTEDVALUE(table[Factor])= "Cost",[Cost],
Blank())

So, with this measure I just can create a matrix as below 
table.3.PNG
 
Now I wanna create a measure so that the Cost (Exclude factor ) = Cost - Factors appearing in matrix like this one:

table1.PNG

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.