Forum Discussion
akhtar0507
4 years agoFrequent Visitor
P&L Help
Hello, I have finally got my report to ressemble an income statement and all my measures are working fine individually. However, when I am summing my cost of sales and cost of sales B, it is retu...
- 4 years ago
Try:
_currentItem = "Total Cost of Sales", CALCULATE( [GL Cost of sales Only], ALL ( GL Segment )) + CALCULATE ( [GL Cost of sales B], ALL ( GL Segment) ))
PaulDBrown
4 years agoCommunity Champion
what are the measures in the total calculation?
akhtar0507
4 years agoFrequent Visitor
Hello PaulDBrown,
The total contains Coat of sales B and Cost of Sales Only.
Thank you for helping.
- PaulDBrown4 years agoCommunity Champion
Right, but can post the code for each measure?
- akhtar05074 years agoFrequent VisitorGL Cost of sales Only =VAR _glGrouping = CALCULATETABLE( 'GL Segment', 'GL Segment'[GL Grouping] = "Cost of Sales")VAR _netGL = [Net GL]returnCALCULATE([Net GL],_glGrouping)GL Cost of sales B =VAR _glGrouping = CALCULATETABLE('GL Segment', 'GL Segment'[GL Grouping] = "Cost of Sales B")VAR _netGL = [Net GL]returnCALCULATE([Net GL],_glGrouping)and for [Net GL] = sum(Debit) - sum(Credit) from the GL table.
- PaulDBrown4 years agoCommunity Champion
Try:
_currentItem = "Total Cost of Sales", CALCULATE( [GL Cost of sales Only], ALL ( GL Segment )) + CALCULATE ( [GL Cost of sales B], ALL ( GL Segment) ))