Get help to amend my syntax

Alan Chen 0 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,777 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Emi Zhang-MSFT 28,056 Reputation points Microsoft Vendor
    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.

    0 comments No comments

  2. Alan Chen 0 Reputation points
    2025-02-26T04:04:08.97+00:00

    I re-write the syntax as follows, it works

    User's image

    0 comments No comments

  3. Alan Chen 0 Reputation points
    2025-02-26T04:26:50.57+00:00

    Thanks you help.

    I have another question that how i can add syntax to the measure for the "EARNING BEFORE INTEREST AND TAX" and "NET PROFIT"??

    User's image

    0 comments No comments

  4. Emi Zhang-MSFT 28,056 Reputation points Microsoft Vendor
    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.