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

View all the Fabric Data Days sessions on demand. View schedule

Reply
gvg
Post Prodigy
Post Prodigy

Get value in a separate column

Hi there,

 

I am looking to put a sum of some value into a separate column on a specific row in a table visual. This is my raw table and the expected result in table visual:

 

Col1   Amount                     Col1  SumAmount  MinusAmount
1         10                      1       30       - 7 
1         20                      2       70
2         30                      3       -7
2         40
3        - 7

I thought a simple measure like this will do the trick but it doesn't :

 

MinusAmount = IF ( MAX (Table[Col1] = 1, CALCULATE ( SUM ( Table[Amount] ), Col1 = 3 ) )

 

Would appreciate any hints. Thanks.

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @gvg

 

Your code's logic is sound. It should work with very minor changes: 

 

MinusAmount =
IF (
    MAX ( 'Table'[Col1] ) = 1,
    CALCULATE ( SUM ( 'Table'[Amount] ), 'Table'[Col1] = 3 )
)

View solution in original post

3 REPLIES 3
AlB
Community Champion
Community Champion

Hi @gvg

 

Your code's logic is sound. It should work with very minor changes: 

 

MinusAmount =
IF (
    MAX ( 'Table'[Col1] ) = 1,
    CALCULATE ( SUM ( 'Table'[Amount] ), 'Table'[Col1] = 3 )
)
gvg
Post Prodigy
Post Prodigy

OK, thanks @AlB. I happen to have some more columns in my visual and it looks that I need to use measure with ALLSELECTED:

 

MinusAmount = 
IF (
    MAX ( Table1[Col1] ) = 1,
    CALCULATE ( SUM ( Table1[ Amount] ), FILTER(ALLSELECTED(Table1),Table1[Col1] = 3 ) )
)
gvg
Post Prodigy
Post Prodigy

OK, it works in this simple table, but it doesn't if I add another column, like here:

 

Capture.JPG

 

I get this:

 

Capture.JPG

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