Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi there,
Recently I had a question about how can I extrapolate the national sales if I have partial information only.
Now I need to bring this model to the next level, where the extrapolated values are displayed in a matrix visual, and the products are combined into product hierarchies. E.g Prod 1 and Prod 3 belong to ProdHier1, and Prod 2 and Prod 4 belong to ProdHier2, and also ProdHier1 and ProdHier2 belong to ParentHier1.
My problem is when I'm displaying the values in a matrix visual, the subtotals of the extrapolated provinces (AB and SK) are not correct, while the subtotals of the provinces with actual data (BC and ON) are correct:
Can someone please let me know how can I fix the displayed subtotals for the extrapolated provinces?
Bonus question: what if I need to organize the customers to hierarchies too (e.g Cust 1 and Cust 2 are "Key Accounts", Cust 3, Cust 4 and Cust 5 are "Other customers")?
For reference, the pbix file is uploaded here.
Thanks,
kukszi
Solved! Go to Solution.
Try this:
Replace the AllExcept part of your Extrapolation total measure with this
If this works for you, please mark it as solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@kukszi , I changed it, see if works
Extrapolated Total =
VAR __actuals =
SUM ( Actuals[Volume] )
VAR __extrapolation =
SUMX (
Extrapolate,
Extrapolate[ExtrapolationFactor]
* CALCULATE (
SUM ( Actuals[Volume] ),
ALLEXCEPT ( Actuals, Actuals[Product] ,Actuals[ProdHier]),
TREATAS ( VALUES ( Extrapolate[BaseToBeUsed] ), Actuals[Province] ),
TREATAS ( VALUES ( Extrapolate[Customer] ), Actuals[Customer] )
)
)
RETURN
__actuals + __extrapolation
Try this:
Replace the AllExcept part of your Extrapolation total measure with this
If this works for you, please mark it as solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |