Get help to amend my syntax

Alan Chen 60 Reputation points
2025-02-25T17:45:00.9333333+00:00

I have two separate syntax to sum up value. Could anyone help me to combine the syntaxs in one go?

User's image

User's image

Excel Management
Excel Management
Excel: A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.Management: The act or process of organizing, handling, directing or controlling something.
1,835 questions
0 comments No comments
{count} votes

Accepted answer
  1. Emi Zhang-MSFT 29,371 Reputation points Microsoft External Staff
    2025-02-26T02:20:22.28+00:00

    Hi,

    To combine these into a single expression, you can use the AND function within the CALCULATE function to include both conditions:

    TOTAL_COMBINED = CALCULATE(
        SUM('Ledger'[Net]),
        'Ledger'[Category] = SELECTEDVALUE(IsStructure[Category]),
        'Ledger'[Row Index] = SELECTEDVALUE(IsStructure[Row Index])
    )
    

    Just checking in to see if the information was helpful. Please let us know if you would like further assistance.


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Emi Zhang-MSFT 29,371 Reputation points Microsoft External Staff
    2025-02-26T05:27:45.1566667+00:00

    Hi,

    To add measures for "Earnings Before Interest and Tax (EBIT)" and "Net Profit" in DAX, you can use the following syntax:

    Earnings Before Interest and Tax (EBIT)

    EBIT = 
    CALCULATE(
        SUM('Ledger'[Net]),
        'Ledger'[Category] = "Revenue"
    ) - 
    CALCULATE(
        SUM('Ledger'[Net]),
        'Ledger'[Category] = "Expenses"
    )
    

    Net Profit

    Net_Profit = 
    CALCULATE(
        SUM('Ledger'[Net]),
        'Ledger'[Category] = "Revenue"
    ) - 
    CALCULATE(
        SUM('Ledger'[Net]),
        'Ledger'[Category] = "Expenses"
    ) - 
    CALCULATE(
        SUM('Ledger'[Net]),
        'Ledger'[Category] = "Interest"
    ) - 
    CALCULATE(
        SUM('Ledger'[Net]),
        'Ledger'[Category] = "Taxes"
    )
    

    Hope the information is helpful.


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.