DAX Allocation Issue
-
9 สิงหาคม 2555 2:23
I have a situation where I need to allocate dollar amounts from one slice to another slice based on ratios. The basic ratios calcuate appropriately at the leaf level:
[ToBeAllocatedALBD]*[ALBD]/1000
I am having trouble getting them to aggregate (Sum) at any upper levels. I have one that "sort of" works, but it only works where the "Allocated To" slice originally exists in the model (for my Revenue accounts) .
For my accounts where no data exists in the original data pull (Depreciation), no value is calculated. I converted the model to Tabular so I could evaluate the statements, and created a "Generate" statement which creates an appropriate table of intesections with the Correct and COMPLETE calculations at the Leaf Level:
Evaluate Filter( Summarize ( Generate ( SUMMARIZE(ActualUSDBalanceExtract, ProgramMappingTable[REPORT_PROGRAM],ProgramMappingTable[HAL Ship],Years[Month]), SUMMARIZE(AccountMappingTable,AccountMappingTable[PARENT] /*HAL SHIP*/)), /*This section creates the "master Table" of values*/ AccountMappingTable[PARENT], ProgramMappingTable[REPORT_PROGRAM], Years[Month], ProgramMappingTable[HAL Ship], "AccountFilter", AccountMappingTable[PARENT], "ProgramFilter", ProgramMappingTable[REPORT_PROGRAM], "YearFilter",Years[Month], "ShipFilter", ProgramMappingTable[HAL Ship], "FancyAllocation", (IF(isblank([ToBeAllocatedALBD]) || isblank([ALBD]),0, [ToBeAllocatedALBD]*[ALBD]/1000)) ), (([AccountFilter] = [PARENT] && [ShipFilter]=[HAL Ship])&& ([YearFilter]=[Month]) && ([ProgramFilter]=[REPORT_PROGRAM])))
When I try to wrap this in a SUMX() statement, it still does not show all of the leaf values. The VERY strange thing is that my Total is correct, but the Leaf values which make up this amount do not display.
Thanks, Barbara
=SUMX (FILTER (SUMMARIZE(ActualUSDBalanceExtract, ProgramMappingTable[REPORT_PROGRAM],ProgramMappingTable[HAL Ship],Years[Month], "ShipFilter", ProgramMappingTable[HAL Ship], "YearFilter",Years[Month], "ProgramFilter", ProgramMappingTable[REPORT_PROGRAM], "TBA_ALBD",[ToBeAllocatedALBD], "Base_ALBD",[ALBD]), (([ShipFilter]=[HAL Ship])&& ([YearFilter]=[Month]) && ([ProgramFilter]=[REPORT_PROGRAM]))), Calculate([ToBeAllocatedALBD]*[ALBD]/1000, Summarize(ActualUSDBalanceExtract, ActualUSDBalanceExtract[ReportProgram],ActualUSDBalanceExtract[Ship],ActualUSDBalanceExtract[PERIOD_NAME])))
- แก้ไขโดย BarbaraRaney 9 สิงหาคม 2555 2:24
ตอบทั้งหมด
-
12 ตุลาคม 2555 14:18

