Forum Discussion
Distinct Count of Dates with Multiple Values - Part II
I'll give you a piece of good advice: Never, ever use SUMMARIZE for anything else than getting the distinct combinations from a table. There is an article on www.sqlbi.com by Marco Russo and Alberto Ferrari that discusses the dangers of violating this rule. The SUMMARIZE function does not work properly and can't be fixed due to technical reasons, therefore please refrain from calculating anything under it. Use it just for grouping, nothing else. I'm not saying that you've been bitten by this very issue but it well might be and it'll be very hard to debug if it has. Just change the code to use the combination SUMMARIZE/ADDCOLUMNS as the article @SQLBI prescribes.
I wish I could help you more but... I don't know the model and can't see any reasonable data on which you could demonstrate "in slow motion" what you want the code to do.