Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi there,
I need to build a model in Power BI which extrapolates sales numbers, but I don't know how to start. The concept is the following: I have sales volume for Ontario and BC, and would like to extrapolate in order to get the total Canada sales.
The data I have is the following:
Actuals:
Customer | Province | Product | Volume |
Cust 1 | ON | Prod 1 | 100 |
Cust 1 | ON | Prod 2 | 200 |
Cust 1 | BC | Prod 1 | 80 |
Cust 1 | BC | Prod 2 | 170 |
Cust 2 | ON | Prod 1 | 500 |
Cust 2 | ON | Prod 2 | 350 |
Cust 2 | BC | Prod 1 | 200 |
Cust 2 | BC | Prod 2 | 300 |
Extrapolation parameters:
Customer | In Province | Base to be used | Extrapolation factor |
Cust 1 | AB | ON | 70% |
Cust 1 | SK | ON | 40% |
Cust 2 | AB | BC | 110% |
Cust 2 | SK | BC | 60% |
Expected outcome:
Cust 1:
ON Prod 1 = 100
ON Prod 2 = 200
BC Prod 1 = 80
BC Prod 2 = 170
AB Prod 1 = 100 x 70% = 70
AB Prod 2 = 200 x 70% = 140
SK Prod 1 = 100 x 40% = 40
SK Prod 2 = 200 x 40% = 80
Total National Sales to Cust 1 = 880
Cust 2:
ON Prod 1 = 500
ON Prod 2 = 350
BC Prod 1 = 200
BC Prod 2 = 300
AB Prod 1 = 200x 110% = 220
AB Prod 2 = 300x 110% = 330
SK Prod 1 = 200x 60% = 120
SK Prod 2 = 300x 60% = 180
Total National Sales to Cust 2 = 2200
Total National Sales to Cust 1 and Cust 2 = 3080
What is the best way to build a calculation like the above explained?
Thanks in advance!
Solved! Go to Solution.
Here is one way to do it.
1. Make two DAX tables for Customers and Provinces with these two expressions
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.
Here is one way to do it.
1. Make two DAX tables for Customers and Provinces with these two expressions
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.
Hi Pat,
This is great, thank you very much. The values in the "Extrapolated Total" column are calculated properly, but when I'm summarizing the individual rows, the result is 3,080 and not 7,220. How can I fix the totals?
Thanks,
Kukszi
Not sure what you mean. Are you using the measure in a matrix visual? What is the field for columns? In any case, total problems are often solved with this kind of an approach:
IteratorMeasure = SUMX(VALUES(Table[RowOrColumn in Visual]), [Extrapolated Total])
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.
I'm using table visual as you suggested, which looks like this:
Also, tried the IteratorMeasure, which gave a completely different result.
When I'm adding up manually the values in Extrapolated Totals column, I get 3080 and not 7220. Am I doing something wrong?
Hi @kukszi ,
Please try to update the formula of measure "IteratorMeasure" as below:
IteratorMeasure= SUMX(VALUES('Customers'[Customer]),SUMX(VALUES('Provinces'[Province]), SUMX(VALUES('Actuals'[Product]),[Extrapolated Total])))
Best Regards
Rena
Thank you Rena, it worked!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
100 | |
78 | |
76 | |
52 |
User | Count |
---|---|
144 | |
109 | |
108 | |
88 | |
61 |