Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Issues with subtotals

Challenge 1 - Sum the Team Sales and return those sale for each person on the team while keeping each non-team member (i.e. Employees 4+5) separate as their own non related line item.
Challenge 2 - In the Team A Subtotal, return the total for the team vs. summing each employee line item.
Challenge 3 - The manager should be the total of Team A plus the 2 Employees who do not belong to Team A.
Result issues in red.        
         
I've tried the following solution from this post but its not working for this circumstance.  I've also tried modifying this solution but have been unsuccessful in getting it to work.    
https://community.powerbi.com/t5/Desktop/Sum-of-values-based-on-distinct-values-in-other-column/m-p/96539    
         
Measure = MAXX(DISTINCT(Hierarchy[Team]),MAX(Sales[Sales]))       
SumSales = SUMX(DISTINCT(Hierarchy[Team]),[Measure])       
Sales MTD = CALCULATE([SumSales]),DATESMTD(Sales[Result Period]))      
Sales YTD = CALCULATE([SumSales]),DATESYTD(Sales[Result Period]))       
         
Hierarchy and Sales tables are related to one another using a HierarchyKey with a one to many relationship.    
         
         
Correct Result  MonthlyYTD through March
ManagerEmployee TeamEmployee NameSalesTarget%SalesTarget%
Manager 1Team AEmployee 19000060000150%270000180000150%
Manager 1Team AEmployee 29000060000150%270000180000150%
Manager 1Team AEmployee 39000060000150%270000180000150%
  Team A Subtotal9000060000150%270000180000150%
Manager 1 Employee 4100003000033%300009000033%
Manager 1 Employee 5100003000033%300009000033%
Manager 1  11000012000092%33000036000092%
         
         
Result I'm Getting  MonthlyYTD through March
ManagerEmployee TeamEmployee NameSalesTarget%SalesTarget%
Manager 1Team AEmployee 16000060000100%180000180000100%
Manager 1Team AEmployee 2300006000050%9000018000050%
Manager 1Team AEmployee 30600000%01800000%
   9000018000050%27000054000050%
Manager 1 Employee 4100003000033%3000030000100%
Manager 1 Employee 5100003000033%3000030000100%
Manager 1  11000024000046%33000060000055%

2 Replies