Can anyone help me with this?

Badrul

New Member
Joined
Sep 25, 2013
Messages
28
I have two tables.
PivotVwMain - this has the data I need to sum up
tblReportStruct - this is a table containing that looks like this:

FSLineItemDisplayTxt isCalculated
Sales 0
COS 0
Gross margin 1

The Sales and COS exist in the main data table and the two tables are linked by the FSLineItemDisplayTxt so the formula below correctly sums up the sales and COS.

However the gross margin does not exist in the main table, instead I want to sum up Sales and COS together to get them, which I presume means removing the FSLineItemDisplayTxt filter as I tried to do below but it isn't working

Measure 1:=IF(Sum(tblReportStruct[IsCalculated])=1,CALCULATE(Sum(PivotVwMain[Amount]),ALL(tblReportStruct[FSLineItemDisplayTxt])) ,Sum(PivotVwMain[Amount]))




Can anyone help me out here?
There is a second part to this question though starting with the above would be a good first step.
The main table has more than just Sales and CO and I have a third table that I need to somehow use which tells me which rows from the main data I need to sum of to calculate Gross margin.
This table looks like:
FSLineItemDisplayTxt maintableID
Gross margin 22 (i.e. Sales)
Gross margin 23 (i.e. COS)
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,214,915
Messages
6,122,214
Members
449,074
Latest member
cancansova

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top