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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
adraus
Frequent Visitor

Subtract two columns

 
3 REPLIES 3
v-cgao-msft
Community Support
Community Support

Hi @adraus ,

 

Is [Earnings] a measure? If so, please try this measure.

_Total = 
SUMX (
    SUMMARIZE (
        '_GroupEarnings',
        '_GroupEarnings'[Year],
        '_GroupEarnings'[Payperiod],
        "Earings", [Earnings],
        "dedamount", SUM ( _GroupDeductions[_DedAmount] )
    ),
    [Earnings] - [dedamount]
)

If this doesn't work for you, would you mind sharing a sample file with no privacy? Thanks in advance.

 

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

adraus
Frequent Visitor

Hi.  Thank you for your response.

The results of my latest attempt ar shown here.  This is wrong, of course.  It should show the net amount for each line.  The first line should have 1869.95.  The second should be 1978.06, etc.

adraus_0-1653406339906.png

 

I have the two tables, _GroupEarnings and _GroupDeductions, linked by the fields _EmplAndPeriod (ie:  

adraus_1-1653406470001.png

 

One thing that bothers me is that the field, _DedAmount, has the 'sum' symbol in front of it, while the field _EarnAmount does not.  I'm not sure where that came from when I created the field, _DedAmount, or why it's there:

adraus_2-1653406653676.png

 

 

amitchandak
Super User
Super User

@adraus , In DAx

new column = [Column 2] - [Column 1]

 

 

The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.