Forum Discussion
Separate Count Based on Date
I'm trying to put together a visual comparing an announcement date against the number of people who call when the announcement goes out. Ideally, the CallId column should be fluctuating up and down based on the number of calls per day or month, but for some reason, the Count of CallId is just giving the Sum of all calls rather than the actual number of calls. The messages are fluctuating up and down as intended, but not the calls. I don't know why. I've got the Dates of the calls, messages, and announcements on the x-axis and the Counts of the CallIds, AnnouncementIds, and MessageIds on the y-axis.
Hi alyssamarce ,
It should be a problem caused by ignoring the corresponding external filtering context in your formula.
amount_ = sum(FactInternetSales[SalesAmount])amount_all = CALCULATE(SUM(FactInternetSales[SalesAmount]),ALL(FactInternetSales))In the second formula, all external filtering filtering contexts are cleared, including the MonthNumberOfYear field on the x-axis.
Modify the corresponding formula to keep the filter result of the MonthNumberOfYear field, then the result is correct.
amount_all = CALCULATE ( SUM ( FactInternetSales[SalesAmount] ), ALLEXCEPT ( DimDate, DimDate[MonthNumberOfYear] ) )
If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- v-henryk-mstfCommunity Support
Hi alyssamarce ,
It should be a problem caused by ignoring the corresponding external filtering context in your formula.
amount_ = sum(FactInternetSales[SalesAmount])amount_all = CALCULATE(SUM(FactInternetSales[SalesAmount]),ALL(FactInternetSales))In the second formula, all external filtering filtering contexts are cleared, including the MonthNumberOfYear field on the x-axis.
Modify the corresponding formula to keep the filter result of the MonthNumberOfYear field, then the result is correct.
amount_all = CALCULATE ( SUM ( FactInternetSales[SalesAmount] ), ALLEXCEPT ( DimDate, DimDate[MonthNumberOfYear] ) )
If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.