Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2020
1,188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1. SP Display =
  2. Var OrderNum = SELECTEDVALUE('IS Structure'[ORDER],999)
  3. Var CMWarehouse = CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=2))
  4. -CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=18))
  5. Var CMDirects = CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=3))
  6. -CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=19))
  7. Var CMFreight = CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=4))
  8. -CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=23))
  9. Var CMOther = CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=5))
  10. +CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=4.1))
  11. -CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=24))
  12. Var CMTotal = CMWarehouse+CMDirects+CMFreight+CMOther
  13. Var GPTotal = CMTotal + CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=54))
  14. 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))
  15. Var IncomeBeforeTaxes = (GPTotal-TotalOverheads)
  16. -CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=153))
  17. -CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=155))
  18. -CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=156))
  19. 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))
  20.  
  21. Return
  22.  
  23. IF(OrderNum IN {36,37,39},
  24. FORMAT(SWITCH(OrderNum,
  25. 36,DIVIDE(CMWarehouse, CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=2))), --CM Warehouse Ratio
  26. 37,DIVIDE(CMDirects,CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=3))), --CM Directs Ratio
  27. 39,DIVIDE(CMWarehouse+CMDirects+CMFreight+CMOther,CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=7)))),"##.##%"), --CM Total Ratio)
  28. FORMAT(SWITCH(OrderNum,
  29. 29,CMWarehouse, --CM Warehouse
  30. 30,CMDirects, --CM Directs
  31. 31,CMFreight, --CM FREIGHT
  32. 32,CMOther, --CM OTHER
  33. 34,CMWarehouse+CMDirects+CMFreight+CMOther, --CM TOTAL
  34. 56,GPTotal, --GP TOTAL
  35. 91.1,OtherBenefits, --Other Benefits
  36. 149,TotalOverheads, --TOTAL OVERHEADS
  37. 151,GPTotal- TotalOverheads, --EBITDA
  38. 158,IncomeBeforeTaxes, --INCOME BEFORE TAXES
  39. 164,IncomeBeforeTaxes
  40. -CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=160))
  41. -CALCULATE([SP Base Measure],filter(ALL('IS Structure'),'IS Structure'[ORDER]=161)), --NET INCOME
  42. CALCULATE([SP Base Measure])
  43. ),"$###,#00"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement