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
Anonymous
Not applicable

Subtract the value of a measure by the value of a column

Hey 🙂
I have a table with the following structure:

Sector  Budget   Year
AAA 6.000 2021
BBB 13.000 2021
CCC 8.000 2021


I also have a measure that calculates the total sum of expenses for each sector (this data coming from another table).
I want a measure that do the Budget - Total Spent, for each Sector,  but I don't know how to subtract the value of a column by a measure.


Can someone help me?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

I think you can subtract the value of a measure by the value of a column by another measure.

Here I build a sample.

Budget Table:

1.png

Expense Table:

2.png

Expense measure:

Measure = 
CALCULATE (
    SUM ( Expense[Expense] ),
    FILTER (
        Expense,
        Expense[ Year] = MAX ( Budget[ Year] )
            && Expense[Sector  ] = MAX ( Budget[Sector  ] )
    )
)
Expense = 
SUMX(Budget,[Measure])

Subtract measure:

Result = SUM(Budget[Budget  ]) - [Expense]

Result is as below.

1.png

Best Regards,

Rico Zhou

 

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

Best Regards,

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous 

I think you can subtract the value of a measure by the value of a column by another measure.

Here I build a sample.

Budget Table:

1.png

Expense Table:

2.png

Expense measure:

Measure = 
CALCULATE (
    SUM ( Expense[Expense] ),
    FILTER (
        Expense,
        Expense[ Year] = MAX ( Budget[ Year] )
            && Expense[Sector  ] = MAX ( Budget[Sector  ] )
    )
)
Expense = 
SUMX(Budget,[Measure])

Subtract measure:

Result = SUM(Budget[Budget  ]) - [Expense]

Result is as below.

1.png

Best Regards,

Rico Zhou

 

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

Best Regards,

amitchandak
Super User
Super User

@Anonymous ,

You need to have a common sector and year/date table , Joining back with these tables

 

Using the common table you can analyze data together (Measure from both tables)

 

Sector Table = distinct(union(distinct(Budget[Sector]),distinct(Actual[Sector])))

 

Bridge Table: https://www.youtube.com/watch?v=Bkf35Roman8&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=19

 

 

In case your data are at a different level

Distributing/Allocating the Yearly Target(Convert to Daily Target): Measure ( Daily/YTD): Magic of CLOSINGBALANCEYEAR With TOTALYTD/DATESYTD: https://community.powerbi.com/t5/Community-Blog/Power-BI-Distributing-Allocating-the-Yearly-Target-Convert-to/ba-p/1476400

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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 Solution Authors