Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SP Display =
- Var OrderNum = SELECTEDVALUE('IS Structure'[ORDER],999)
- Var CMWarehouse = CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=2))
- -CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=18))
- Var CMDirects = CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=3))
- -CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=19))
- Var CMFreight = CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=4))
- -CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=23))
- Var CMOther = CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=5))
- +CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=4.1))
- -CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=24))
- Var CMTotal = CMWarehouse+CMDirects+CMFreight+CMOther
- Var GPTotal = CMTotal + CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=54))
- Var TotalOverheads = CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=149))+CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=94))
- Var IncomeBeforeTaxes = (GPTotal-TotalOverheads)
- -CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=153))
- -CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=155))
- -CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=156))
- Var OtherBenefits = CALCULATE([SP Base Measure],filter(all('IS Structure'),'IS Structure'[ORDER]=92))-CALCULATE([SP Base Measure],filter(all('IS Structure'),'IS Structure'[ORDER] <=91&&'IS Structure'[ORDER]>=73))
- Return
- IF(OrderNum IN {36,37,39},
- FORMAT(SWITCH(OrderNum,
- 36,DIVIDE(CMWarehouse, CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=2))), --CM Warehouse Ratio
- 37,DIVIDE(CMDirects,CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=3))), --CM Directs Ratio
- 39,DIVIDE(CMWarehouse+CMDirects+CMFreight+CMOther,CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=7)))),"##.##%"), --CM Total Ratio)
- FORMAT(SWITCH(OrderNum,
- 29,CMWarehouse, --CM Warehouse
- 30,CMDirects, --CM Directs
- 31,CMFreight, --CM FREIGHT
- 32,CMOther, --CM OTHER
- 34,CMWarehouse+CMDirects+CMFreight+CMOther, --CM TOTAL
- 56,GPTotal, --GP TOTAL
- 91.1,OtherBenefits, --Other Benefits
- 149,TotalOverheads, --TOTAL OVERHEADS
- 151,GPTotal- TotalOverheads, --EBITDA
- 158,IncomeBeforeTaxes, --INCOME BEFORE TAXES
- 164,IncomeBeforeTaxes
- -CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=160))
- -CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=161)), --NET INCOME
- CALCULATE([SP Base Measure])
- ),"$###,#00"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement