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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Qianru221
Helper II
Helper II

Sales Forecast using R in Power BI

Hi all,

 

I am doing a forecast on future sales quantity and here are the details of the problem.

 

- The history of the Quantity sold is loaded into Power BI.

- The history of the Holidays and Employee absence are also loaded into Power BI

- Both data are connected with TimeID Query.

- It is believed that part of the Sales variation can be explained by Holidays and employee(sales) absence.

 

Therefore now I would like to forecast future sales Quantity against time in the future, taking into factors of holidays and employee absence using R. Would it be possible to provide me with a sample code or sth so that I can implement into the Power BI?

 

I tried to use existing visuals to do the forecast but most of them yielded a straight line into the future....which is not really what I wished for....

 

Thanks in advance!

 

Best,

Qianru.

 

2 ACCEPTED SOLUTIONS
VCQ
Frequent Visitor

This is a really open ended question. There are a lot of different ways to forecast this particular point(Regressions, time series analysis, etc....) If I were you I would check R stack or math forums. 

View solution in original post

Anonymous
Not applicable

Hi @Qianru221,

 

Maybe you can try to use R forecast pack, below is the sample:

Forecast Table - R script

Forecasting Time Series With R

 

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Qianru221,

 

Maybe you can try to use R forecast pack, below is the sample:

Forecast Table - R script

Forecasting Time Series With R

 

Regards,

Xiaoxin Sheng

VCQ
Frequent Visitor

This is a really open ended question. There are a lot of different ways to forecast this particular point(Regressions, time series analysis, etc....) If I were you I would check R stack or math forums. 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 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.