GiantPygmy
New Member
- Joined
- Jul 26, 2016
- Messages
- 6
I need I have a table that has medication on it and a transaction amount. There will be multiple entries due to adjustments and insurance for one medication and one order that went out. I have a measure that basically sums those up and then on the pivot table it will show correctly at the patient and order level. (below is example data table being used) The vendor Ml per box and Vendor Cost are just brought in from a dim table for math purposes and should not be summed (only need the amount it each once). I have in in included the measures I'm using below as well. They are insistent they want a slicer that simply says "Positive" or "Negative" that will filter the pivot table by ProfitPerBox (ProfitPerBox < 0 then negative else positive) to only show negative or positive amounts. Any help on how to achieve this within Excel PowerPivot would be greatly appreciated.
Pivot Table is:
Rows: Account, Service Date,WorkOrderNumber,Payor,Product
Values: RevenuePerBox,MaxVendorCost,ProftPerBox
MaxBoxes:=MAX(F_REVENUE2[Boxes])
TotalRevenue:=SUM(F_REVENUE2[TransAmount])
MaxVendorCost:=MAX(F_REVENUE2[Vendor Cost per Box])
RevenuePerBox:=[TotalRevenue]/[MaxBoxes]
ProftPerBox:=[RevenuePerBox]-[MaxVendorCost]
<tbody>
</tbody>
Pivot Table is:
Rows: Account, Service Date,WorkOrderNumber,Payor,Product
Values: RevenuePerBox,MaxVendorCost,ProftPerBox
MaxBoxes:=MAX(F_REVENUE2[Boxes])
TotalRevenue:=SUM(F_REVENUE2[TransAmount])
MaxVendorCost:=MAX(F_REVENUE2[Vendor Cost per Box])
RevenuePerBox:=[TotalRevenue]/[MaxBoxes]
ProftPerBox:=[RevenuePerBox]-[MaxVendorCost]
Service Date | Account | WorkOrderNumber | Payor | Qty in ML | Product | TransAmount | Vendor Ml per Box | Vendor Cost per Box |
9/4/2018 | 111 | 444444 | MEDICARE REGION D - NEW | 360 | Ipratropium-Albuterol | 0.31 | 90 | 3.06 |
9/4/2018 | 111 | 444444 | MEDICARE REGION D - NEW | 120 | Budesonide | 0.56 | 60 | 60 |
9/4/2018 | 111 | 444444 | MEDICARE REGION D - NEW | 360 | Ipratropium-Albuterol | 289.12 | 90 | 3.06 |
9/4/2018 | 111 | 444444 | MEDICARE REGION D - NEW | 360 | Ipratropium-Albuterol | -272.32 | 90 | 3.06 |
9/4/2018 | 111 | 444444 | MEDICARE REGION D - NEW | 120 | Budesonide | -201.8 | 60 | 60 |
9/4/2018 | 111 | 444444 | MEDICARE REGION D - NEW | 360 | Ipratropium-Albuterol | -0.34 | 90 | 3.06 |
9/4/2018 | 111 | 444444 | MEDICARE REGION D - NEW | 120 | Budesonide | 413.6 | 60 | 60 |
9/4/2018 | 111 | 444444 | MEDICARE REGION D - NEW | 120 | Budesonide | -4.24 | 60 | 60 |
10/8/2018 | 222 | 555555 | MEDICARE REGION D - NEW | 360 | Ipratropium-Albuterol | -273.52 | 90 | 3.06 |
10/8/2018 | 222 | 555555 | MEDICARE REGION D - NEW | 360 | Ipratropium-Albuterol | -0.29 | 90 | 3.06 |
10/8/2018 | 222 | 555555 | MEDICARE REGION D - NEW | 360 | Ipratropium-Albuterol | 289.12 | 90 | 3.06 |
10/8/2018 | 222 | 555555 | MEDICARE REGION D - NEW | 360 | Ipratropium-Albuterol | -0.31 | 90 | 3.06 |
11/28/2018 | 222 | 666666 | MEDICARE REGION D - NEW | 360 | Ipratropium-Albuterol | 289.12 | 90 | 3.06 |
11/28/2018 | 222 | 666666 | MEDICARE REGION D - NEW | 360 | Ipratropium-Albuterol | -0.31 | 90 | 3.06 |
11/28/2018 | 222 | 666666 | MEDICARE REGION D - NEW | 360 | Ipratropium-Albuterol | -273.52 | 90 | 3.06 |
11/28/2018 | 222 | 666666 | MEDICARE REGION D - NEW | 360 | Ipratropium-Albuterol | -0.29 | 90 | 3.06 |
3/27/2018 | 333 | 777777 | MEDICARE REGION D - NEW | 90 | Ipratropium-Albuterol | -0.07 | 90 | 3.06 |
3/27/2018 | 333 | 777777 | MEDICARE REGION D - NEW | 90 | Ipratropium-Albuterol | -68.8 | 90 | 3.06 |
3/27/2018 | 333 | 777777 | MEDICARE REGION D - NEW | 120 | Brovana | -656.83 | 120 | 562.74 |
3/27/2018 | 333 | 777777 | MEDICARE REGION D - NEW | 120 | Budesonide | 413.6 | 60 | 60 |
3/27/2018 | 333 | 777777 | MEDICARE REGION D - NEW | 120 | Budesonide | -3.8 | 60 | 60 |
3/27/2018 | 333 | 777777 | MEDICARE REGION D - NEW | 120 | Budesonide | -223.64 | 60 | 60 |
3/27/2018 | 333 | 777777 | MEDICARE REGION D - NEW | 90 | Ipratropium-Albuterol | 72.28 | 90 | 3.06 |
3/27/2018 | 333 | 777777 | MEDICARE REGION D - NEW | 120 | Brovana | 1224.43 | 120 | 562.74 |
3/27/2018 | 333 | 777777 | MEDICARE REGION D - NEW | 120 | Brovana | -11.35 | 120 | 562.74 |
<tbody>
</tbody>