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! Learn more

Reply
logistics_power
Regular Visitor

Calculating the net total (neg an positive figures)

Hello Experts,

 

I have a matrix visual as below

I want to calculate the net variance from the freight variance column. So for supplier region US it is 500-200+300=600 and for Asia it is 1000-2000+500 = -500

Pleaase note the Total of the freight variance is a row calculated total and not the net of the column figures above it.

 

logistics_power_0-1722485621541.png

 

1 ACCEPTED SOLUTION

Hi, @logistics_power 

All family function must be from same table that's why it give error

Try below measure

Measure = 
CALCULATE(
sumx(
filter(
 SUMMARIZE('Table'[Region],'Table'[city]),
'Table'[Region]=MAX('Table'[Region]) && 'Table'[city]<>"Total"
),[variance_measure])
),KEEPFILTERS('Table'[city]="total"))

 

Best regards,
Dangar 

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
Dangar332
Super User
Super User

Hi, @logistics_power 

Try below measure.
Just rename table and column name.

Measure = 
CALCULATE(SUMX(
    FILTER(
        ALL('Table'[Region],'Table'[city],'Table'[variance]),
        'Table'[Region]=MAX('Table'[Region]) && 'Table'[city]<>"Total"
        ),
        [variance]
),KEEPFILTERS('Table'[city]="total"))

 

Dangar332_0-1722493287102.png

Best regards,
Dangar 

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


 

Thanks for your response @Dangar332 

I am getting an error "The report measure [Variance] has a syntax or semantic error.

ALL/ALLNOBLANK?ALLSELECTED functions must be from the same table.

Just FYI the fields Supplier region, Destination city, Transaction type are from different tables.

Another question in the measure Table'[variance] is a calculated measure itself so does that have to be a part of ALL?

 

Measure =
CALCULATE(SUMX(
FILTER(
ALL('Table'[Region],'Table'[city],'Table'[variance]),
'Table'[Region]=MAX('Table'[Region]) && 'Table'[city]<>"Total"
),
[variance]
),KEEPFILTERS('Table'[city]="total"))

 

Hi, @logistics_power 

All family function must be from same table that's why it give error

Try below measure

Measure = 
CALCULATE(
sumx(
filter(
 SUMMARIZE('Table'[Region],'Table'[city]),
'Table'[Region]=MAX('Table'[Region]) && 'Table'[city]<>"Total"
),[variance_measure])
),KEEPFILTERS('Table'[city]="total"))

 

Best regards,
Dangar 

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.