Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Gross Margin Column For Customer without Creating New Table

Hello,   I am looking to create a column that has the total gross margin for the customer on each row. This is transactional data, so the customers are not unique in the columns. How I would typica...
  • Sean's avatar
    Sean
    9 years ago

    Anonymous

     

    Here's the COLUMN formula that should do it

    GM % COLUMN =
    DIVIDE (
        CALCULATE ( SUM ( 'Table'[Sales] ), ALLEXCEPT ( 'Table', 'Table'[Customer] ) )
            - CALCULATE ( SUM ( 'Table'[Cost] ), ALLEXCEPT ( 'Table', 'Table'[Customer] ) ),
        CALCULATE ( SUM ( 'Table'[Sales] ), ALLEXCEPT ( 'Table', 'Table'[Customer] ) ),
        0
    )

    Hope this helps! :smileyhappy: