Forum Discussion
Plan vs realization
- Anonymous2 years ago
Hi al1981 ,
If we add loops as a filter with salesperson as the filter, then we can make some changes to the original DAX.
PlanCount = CALCULATE (COUNTROWS('Plan'), ALLEXCEPT(Plan,'Plan'[Cycle],'Plan'[Sales Rep]))Hope it helps!
Best regards,
Community Support Team_ Tom ShenIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi al1981 ,
Thank you bhanu_gautam very much for the solution, and I've tried other ways to help you understand the problem:
According to your requirement, I think you are counting the plan will show all the counts, according to the data you gave which is 4,
but you want to count the sales reps individually according to their plan, here is my idea to realize it, maybe it can help you to solve the problem.
PlanCount = SUMX(VALUES('Plan'[Sales Rep]), CALCULATE(COUNTROWS('Plan'),FILTER(ALL('Plan'),Plan[Sales Rep]=MAX('Plan'[Sales Rep]))))ActivityCount = SUMX(VALUES(Activities[Sales Rep]),CALCULATE(COUNTROWS('Activities'),FILTER(ALL('Activities'),'Activities'[Sales Rep]=MAX(Activities[Sales Rep]))))PlanVsActivity = [ActivityCount]-[PlanCount]
Hope it helps!
Best regards,
Community Support Team_ Tom Shen
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
- al19812 years agoHelper II
Dear Anonymous you were correct. Solution offered by bhanu_gautam is something i already tried and i get all counted. Anyway, yours is closer but i would need that calculaton respects one filter more: Cycle. As in plan we have cycle 1 or 2 for same account (1st half a year or 2nd half) it should respect it as now it sums cycle and 2! But i am closer 🙂
- Anonymous2 years agoNot applicable
Hi al1981 ,
If we add loops as a filter with salesperson as the filter, then we can make some changes to the original DAX.
PlanCount = CALCULATE (COUNTROWS('Plan'), ALLEXCEPT(Plan,'Plan'[Cycle],'Plan'[Sales Rep]))Hope it helps!
Best regards,
Community Support Team_ Tom ShenIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.