Forum Discussion
Gross Margin Column For Customer without Creating New Table
- 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:
Well the process should be pretty similar except the way you created the columns in the new Table using SUMMARIZE
Now create Measures instead
Measure to Sum the Sales
Measure to Sum the Costs
Measure for Profit = Measure to Sum the Sales - Measure to Sum the Costs
Create a Table Visual - place Customer in the Rows and the Measures in the Values
If you encounter problems come back here and ask?
I think you'll only need CALCULATE and ALL, ALLSELECTED, ALLEXCEPT if you are doing %
Again your question was pretty general so without any further specifics that's my 2 cents worth :smileyhappy:
- Anonymous9 years agoNot applicable
Thanks for the response. I am wanting to actually have these as columns in the values, not just a visual. ie getting the last column to calculate in the values tab:
Customer Item Sales Cost Customer GM A 1 80 50 50.00% A 2 100 40 50.00% B 1 75 50 45.95% B 2 110 50 45.95% - Sean9 years agoCommunity Champion
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:
- Anonymous9 years agoNot applicable
Just what I wanted. Thanks!