March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I have a usecase that I'm trying to build out that I could use help with. Let's say that I have a sales table which is very simple, like:
Sale Date | Sale Amount |
2023-01-01 | $50 |
2023-01-02 | $65 |
2023-01-03 | $85 |
2023-01-04 | $20 |
I want to be able to use regression or some other way to estimate the total sales amount we could expect to see by the end of the month. The idea is that this calculation should take the real sales amount prior to the maximum date that we have data up to (Jan 4th in this case), and then add that real value to an estimated value for the rest of the month - resulting in a predicted total sales amount per month based on the data we currently have so far.
I've got the regression part working, but it's just the combining of the two in a single calculated measure that is not working. Anyone have any idea how this could work?
Solved! Go to Solution.
Hello @jaggy123,
1. Determine the real sales amount prior to the maximum date available in your data:
RealSalesAmount =
CALCULATE(
SUM('Sales'[Sale Amount]),
'Sales'[Sale Date] <= MAX('Sales'[Sale Date])
)
2. Estimate the sales amount for the remaining days of the month:
EstimatedSalesAmount =
SUMX(
CALENDAR(
MAX('Sales'[Sale Date]) + 1,
EOMONTH(MAX('Sales'[Sale Date]), 0)
),
[RegressionFormula] // Replace [RegressionFormula] with your regression formula
)
3. Combine the real sales amount and the estimated sales amount in a single calculated measure:
PredictedTotalSalesAmount =
[RealSalesAmount] + [EstimatedSalesAmount]
Let me know if you might require any further assistance.
Hello @jaggy123,
1. Determine the real sales amount prior to the maximum date available in your data:
RealSalesAmount =
CALCULATE(
SUM('Sales'[Sale Amount]),
'Sales'[Sale Date] <= MAX('Sales'[Sale Date])
)
2. Estimate the sales amount for the remaining days of the month:
EstimatedSalesAmount =
SUMX(
CALENDAR(
MAX('Sales'[Sale Date]) + 1,
EOMONTH(MAX('Sales'[Sale Date]), 0)
),
[RegressionFormula] // Replace [RegressionFormula] with your regression formula
)
3. Combine the real sales amount and the estimated sales amount in a single calculated measure:
PredictedTotalSalesAmount =
[RealSalesAmount] + [EstimatedSalesAmount]
Let me know if you might require any further assistance.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |