Forum Discussion
Anonymous
4 years agoNot applicable
Subtotal within P&L
Hello, Please can I get some help in getting a subtotal for 'Total Cost of Sales' to appear in the matrix table below? Total revenue and total units traded are currently data values within ...
- 4 years ago
Hi, Anonymous
Please try formula as below:
Output = VAR _Total_cost_of_sales = CALCULATE ( SUM ( 'Project Level Data'[Value] ), FILTER ( ALL ( 'P&L Presentation' ), 'P&L Presentation'[Profit and loss itesms] IN { "Land Traded", "WIP Traded", "Provisions", "Abort Costs" } ) ) VAR _Total_revenue = CALCULATE ( SUM ( 'Project Level Data'[Value] ), FILTER ( ALL ( 'P&L Presentation' ), 'P&L Presentation'[Profit and loss itesms] = "Total Revenue" ) ) VAR _Total_Trading_Profit = _Total_cost_of_sales + _Total_revenue VAR _Trading_Profit_percent = _Total_Trading_Profit / _Total_revenue RETURN SWITCH ( SELECTEDVALUE ( 'P&L Presentation'[Profit and loss itesms] ), "Total Cost of Sales", _Total_cost_of_sales, "Total Trading Profit", _Total_Trading_Profit, "Trading Profit%", FORMAT ( _Trading_Profit_percent, "Percent" ), SUM ( 'Project Level Data'[Value] ) )If it doesn't work, please share your sample file for further research.
Best Regards,
Community Support Team _ Eason
amitchandak
Super User
4 years agoAnonymous , First two screenshot are not clear.
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Also refer, why Grand total is wrong
Anonymous
4 years agoNot applicable
Please see below
Sample data and Desired Output
| Private Units | 30 |
| BTR Units | 10 |
| Affordable Units | 30 |
| Total Units Traded | 70 |
| * | |
| Private Revenue | 8,000 |
| BTR Revenue | - |
| Affordable Revenue | 2,000 |
| Commercial Revenue | 80 |
| Other Revenue | - |
| Total Revenue | 10,080 |
| ** | - |
| Land Traded | - 1,000 |
| WIP Traded | - 2,000 |
| Provisions | - 500 |
| Abort Costs | - 500 |
| Total Cost of Sales | - 4,000 |
| *** | |
| Total Trading Profit | 6,080 |
| Trading Profit % | 60% |
| Project ID | Month | Actual/Forecast | Name | Attribute | Value |
| PB | Jan-22 | Forecast | Potters Avenue | Land Cost | -10 |
| PB | Jan-22 | Forecast | Potters Avenue | Private Units Sold | 20 |
| PB | Jan-22 | Forecast | Potters Avenue | Private Units UnSold | 10 |
| PB | Jan-22 | Forecast | Potters Avenue | Social Units Sold | 20 |
| PB | Jan-22 | Forecast | Potters Avenue | Social Units Unsold | 10 |
| PB | Jan-22 | Forecast | Potters Avenue | Mgmt Provision - Affordable Units Adjustment | 0 |
| PB | Jan-22 | Forecast | Potters Avenue | PRS Units Sold | 5 |
| PB | Jan-22 | Forecast | Potters Avenue | PRS Units Unsold | 5 |
| PB | Jan-22 | Forecast | Potters Avenue | Units | 70 |
| PB | Jan-22 | Forecast | Potters Avenue | Gross Private Revenue | 10000 |
| PB | Jan-22 | Forecast | Potters Avenue | Less Private Incentives | -2000 |
| PB | Jan-22 | Forecast | Potters Avenue | Gross Social Revenue | 2000 |
| PB | Jan-22 | Forecast | Potters Avenue | Less Social Incentives | 0 |
| PB | Jan-22 | Forecast | Potters Avenue | Mgmt Provision - Affordable Revenue Adjustment | 0 |
| PB | Jan-22 | Forecast | Potters Avenue | Gross Commercial Revenue | 100 |
| PB | Jan-22 | Forecast | Potters Avenue | Less Commercial Incentives | -20 |
| PB | Jan-22 | Forecast | Potters Avenue | Freehold Revenue | 0 |
| PB | Jan-22 | Forecast | Potters Avenue | Other Revenue | 0 |
| PB | Jan-22 | Forecast | Potters Avenue | PX Revenue | 0 |
| PB | Jan-22 | Forecast | Potters Avenue | Revenue | 10080 |
| PB | Jan-22 | Forecast | Potters Avenue | Land Released | -1000 |
| PB | Jan-22 | Forecast | Potters Avenue | WIP Released | -2000 |
| PB | Jan-22 | Forecast | Potters Avenue | Completed Unit Provisions | 0 |
| PB | Jan-22 | Forecast | Potters Avenue | Mgmt Provision - Cost of Sales Adjustment | -500 |
| PB | Jan-22 | Forecast | Potters Avenue | Abort Costs | -500 |
- v-easonf-msft4 years ago
Community Support
Hi, Anonymous
Please try formula as below:
Output = VAR _Total_cost_of_sales = CALCULATE ( SUM ( 'Project Level Data'[Value] ), FILTER ( ALL ( 'P&L Presentation' ), 'P&L Presentation'[Profit and loss itesms] IN { "Land Traded", "WIP Traded", "Provisions", "Abort Costs" } ) ) VAR _Total_revenue = CALCULATE ( SUM ( 'Project Level Data'[Value] ), FILTER ( ALL ( 'P&L Presentation' ), 'P&L Presentation'[Profit and loss itesms] = "Total Revenue" ) ) VAR _Total_Trading_Profit = _Total_cost_of_sales + _Total_revenue VAR _Trading_Profit_percent = _Total_Trading_Profit / _Total_revenue RETURN SWITCH ( SELECTEDVALUE ( 'P&L Presentation'[Profit and loss itesms] ), "Total Cost of Sales", _Total_cost_of_sales, "Total Trading Profit", _Total_Trading_Profit, "Trading Profit%", FORMAT ( _Trading_Profit_percent, "Percent" ), SUM ( 'Project Level Data'[Value] ) )If it doesn't work, please share your sample file for further research.
Best Regards,
Community Support Team _ Eason