Hi,
I have a fact table and a product dim with a hierarchy 3 levels: Productcategory --> ProductLine --> Product
Our planing team will release a monthly target for every product, i.e.
ProductCode | Product | Target | month | year |
1 | A | 234 | 1 | 2016 |
1 | A | 238 | 2 | 2016 |
1 | A | 242 | 3 | 2016 |
1 | A | 254 | 4 | 2016 |
1 | A | 289 | 5 | 2016 |
2 | B | 1022 | 1 | 2016 |
2 | B | 1048 | 2 | 2016 |
2 | B | 1122 | 3 | 2016 |
2 | B | 1248 | 4 | 2016 |
2 | B | 1342 | 5 | 2016 |
So now i need to create some reports that show comparision between actual vs target daily, i tried to import the monthly target of each product for everyday : for example, product A- i inserted a new date column :
ProductCode | Product | Target | month | year | date |
1 | A | 234 | 1 | 2016 | 1/1/2016 |
1 | A | 234 | 1 | 2016 | 1/2/2016 |
1 | A | 234 | 1 | 2016 | 1/3/2016 |
1 | A | 234 | 1 | 2016 | 1/4/2016 |
1 | A | 234 | 1 | 2016 | 1/5/2016 |
1 | A | 234 | 1 | 2016 | 1/6/2016 |
1 | A | 234 | 1 | 2016 | 1/7/2016 |
1 | A | 234 | 1 | 2016 | 1/8/2016 |
1 | A | 234 | 1 | 2016 | 1/9/2016 |
1 | A | 234 | 1 | 2016 | 1/10/2016 |
1 | A | 234 | 1 | 2016 | 1/11/2016 |
1 | A | 234 | 1 | 2016 | 1/12/2016 |
1 | A | 234 | 1 | 2016 | 1/13/2016 |
1 | A | 234 | 1 | 2016 | 1/14/2016 |
1 | A | 234 | 1 | 2016 | 1/15/2016 |
1 | A | 234 | 1 | 2016 | 1/16/2016 |
1 | A | 234 | 1 | 2016 | 1/17/2016 |
1 | A | 234 | 1 | 2016 | 1/18/2016 |
1 | A | 234 | 1 | 2016 | 1/19/2016 |
1 | A | 234 | 1 | 2016 | 1/20/2016 |
1 | A | 234 | 1 | 2016 | 1/21/2016 |
1 | A | 234 | 1 | 2016 | 1/22/2016 |
1 | A | 234 | 1 | 2016 | 1/23/2016 |
1 | A | 234 | 1 | 2016 | 1/24/2016 |
1 | A | 234 | 1 | 2016 | 1/25/2016 |
1 | A | 234 | 1 | 2016 | 1/26/2016 |
1 | A | 234 | 1 | 2016 | 1/27/2016 |
1 | A | 234 | 1 | 2016 | 1/28/2016 |
1 | A | 234 | 1 | 2016 | 1/29/2016 |
1 | A | 234 | 1 | 2016 | 1/30/2016 |
1 | A | 234 | 1 | 2016 | 1/31/2016 |
and use MAX fuction in DAX : Acctualvs.Target = SUM(Quantity)/Avg(Target). However, when i show only Product in report then the result was correct but when i show Product hierarchy with ProductCategory||ProductLine|| Product in report, the result was incorrectly because the avg function was not sum total product target for each Productline and Sum total Productline target for Product Category!.
Please give me some advice to resolve this issue, it is very important in all my report! daily actual vs monthly target.
Thanks & best regards,
J.