Forum Discussion
SUMMARIZE, SUMX not working as expected
Hi,
my DAX ...
... so, the Total of 24 does not match whats listed, should be 89.
89 is confirmed correct by background MS SQL queries over the same datasource.
Results for column Position_Headcount_3 shows that, what looks like, the SUMMARIZE statement skips rows.
I'd appreciate any suggestion or comment why this doesn's work.
One clue I found (Google Search) hinted that the new/temp SUMMARIZE table creates a unique identifier on Helper_Value (which is just a number), so I tried this DAX ...
... more specific, this DAX works, gives me the correct Total:
Position_Headcount =VAR turnover_position = SELECTEDVALUE(FACT_turnover[Position])VAR Helper_Table = ADDCOLUMNS( SUMMARIZE('FACT_turnover',[Position],"Helper_Position", turnover_position), "Helper_Count", [Position_HeadCount_1])RETURNIF(HASONEVALUE(Fact_turnover[Position]),[Position_HeadCount_1],SUMX(Helper_Table, [Helper_Count]))
3 Replies
- MoodyDirkNew Member
... sorry folks, should have searched before.
The answer is here
- v-xiaosun-msft
Community Support
Hi MoodyDirk ,
Glad that you have solved the problem by yourself! If you don't have other problems, could you please accept your answer as the solution? Then we are able to close the thread.
Best Regards,
Community Support Team _ xiaosunIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- MoodyDirkNew Member
... more specific, this DAX works, gives me the correct Total:
Position_Headcount =VAR turnover_position = SELECTEDVALUE(FACT_turnover[Position])VAR Helper_Table = ADDCOLUMNS( SUMMARIZE('FACT_turnover',[Position],"Helper_Position", turnover_position), "Helper_Count", [Position_HeadCount_1])RETURNIF(HASONEVALUE(Fact_turnover[Position]),[Position_HeadCount_1],SUMX(Helper_Table, [Helper_Count]))