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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
windynan
Advocate I
Advocate I

Creating DAX to predict future data - forecasting based on another measure

I am trying to create a measure to predict current year and future year's data on a trend chart. Like below, I have unites and sales records in one table. I created these two charts by applying a filter, which shows if the record is sales or unit. However, I only have sales forecast data for 2021 and 2022. Using sales YoY changes, I want to create a DAX for unit prediction. 

Here is the logic I want to create, and anyone know the correct syntax?

 

If year(FY First Day) >= year(dateadd(today(),+6,'month')), then previous year's unit*sales YoY change. 

 

For example, in this chart, I want to calculate the sales changes from 2021 to 2022. Using this fraction as a factor to multiply the unit in 2021 to get 2022's prediction. 

 

windynan_1-1626213288031.png

 

Below are the dataset...

FY First Day  Amt Category
2019-01-01 0:00                              123 unit A
2019-01-01 0:00                           2,341 unit B
2019-01-01 0:00                          2,323 sales
2020-01-01 0:00                           1,234 unit A
2020-01-01 0:00                              200 unit B
2020-01-01 0:00                              234 sales
2020-01-01 0:00                           2,543 sales
2021-01-01 0:00                              124 unit A
2021-01-01 0:00                              200 unit B
2021-01-01 0:00                              123 sales
2021-01-01 0:00                           3,456 sales
2022-01-01 0:00                              20 unit A
2022-01-01 0:00                             5400 sales

 

 

 

2 REPLIES 2
Icey
Community Support
Community Support

Hi @windynan ,

 

Please check if this post could help you: Solved: Running Increase of Forecast based on Actuals - Microsoft Power BI Community.

 

It calculated forecast vlaues based on actual values.

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

In the Table that you have shown, please show the expected result in another column.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Power BI Header Change

Power BI Header Update

Read about the exciting updates for the Power BI forum.