Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
12Pro
New Member

DAX for Prediction

Hi everyone, I’m facing a challenge and would appreciate some guidance. I need to calculate a ratio based on the last three months of data and use that to predict the quantity for the next nine months.

 

Here’s the situation: I have two columns of data: one represents the approximate volume for the whole year, and the other contains the real-time quantity, which gets updated over time. For example, if we are currently in September, I need to calculate the ratio using data from June to August. Based on this ratio, I need to predict the real-time quantity for the upcoming nine months.

 

Any insights on how I can approach this would be really helpful. Thank you!

2 ACCEPTED SOLUTIONS
rubayatyasmin
Community Champion
Community Champion

Hi, @12Pro 

 

Check out already solved soluton here, 

Solved: Re: Prediction - Microsoft Fabric Community

refer: Solved: Prediction calculation - Microsoft Fabric Community


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


View solution in original post

Kedar_Pande
Super User
Super User

Calculate the Last Three Months' Real-Time Quantity:

LastThreeMonthsQty = 
CALCULATE(
SUM(YourData[RealTimeQuantity]),
DATESINPERIOD(DateTable[Date], MAX(DateTable[Date]), -3, MONTH)
)

 

Calculate the Ratio

Ratio = 
DIVIDE(
[LastThreeMonthsQty],
SUM(YourData[AnnualVolume]),
0
)

Predict Quantity for the Next Nine Months:

PredictedQtyNextNineMonths = 
[Ratio] * SUM(YourData[AnnualVolume]) * (9 / 12) // Adjust as necessary based on your prediction logic

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @12Pro ,

Thanks for rubayatyasmin's and Kedar_Pande 's replies!
@12Pro , please check whether their solutions are what you want? If they help you solve your problem, accept their replies as solutions to help more others facing the same problem to find a solution quickly, thank you very much!
If these responses didn't help you, could you please provide some sample data and your expected results, and could you please describe exactly what kind of calculation process you are referring to when you say you are predicting the next 9 months, please?

Best Regards,
Dino Tao

Kedar_Pande
Super User
Super User

Calculate the Last Three Months' Real-Time Quantity:

LastThreeMonthsQty = 
CALCULATE(
SUM(YourData[RealTimeQuantity]),
DATESINPERIOD(DateTable[Date], MAX(DateTable[Date]), -3, MONTH)
)

 

Calculate the Ratio

Ratio = 
DIVIDE(
[LastThreeMonthsQty],
SUM(YourData[AnnualVolume]),
0
)

Predict Quantity for the Next Nine Months:

PredictedQtyNextNineMonths = 
[Ratio] * SUM(YourData[AnnualVolume]) * (9 / 12) // Adjust as necessary based on your prediction logic

 

rubayatyasmin
Community Champion
Community Champion

Hi, @12Pro 

 

Check out already solved soluton here, 

Solved: Re: Prediction - Microsoft Fabric Community

refer: Solved: Prediction calculation - Microsoft Fabric Community


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.