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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Combining sales and forecast in one column, forecast not aggregating

I am trying to get the actuals and forecast into one column so I can plot it in a trendline where the actuals simply overflow into forecast. 

 

I got one main table including Finance Date, Actuals, and Forecast. It looks like this: 

 

Finance Date

Actuals

Forecast

10-2021

100

200

11-2021

150

250

12-2021

0

200

01-2021

0

230

 

I created a simple dax to get the actuals only untill the date that we have actuals (so exluding zeros), and I got the remaining forecast. The two dax look like this: 

Sales = IF ( Main[Actuals] <> 0, Main[Actuals], BLANK ()

Remaining forecast = IF ( Main[Actuals = 0, Main[Forecast], BLANK ()

 

Initialy, this looks like it is correct, but when I plot it in a table, the forecast is not aggregating: 

 

Finance Date

Actuals

Forecast

Remaining Sales

Remaining Forecast

10-2021

100

200

100

 

11-2021

150

250

150

 

12-2021

0

200

 

200

01-2021

0

230

 

230

Total

250

880

250

THIS REMAINS BLANK

1 ACCEPTED SOLUTION
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous 

 

Please try to use this formula to calculate your Remaining Forecast.

Remaining forecast =

VAR selectValue =

    IF ( Main[Actuals] = 0, Main[Forecast], INT ( BLANK () ) )

RETURN

    selectValue

 

After that, use this Calculated column to combine sales and forecast.

CombiningValues = IF(Main[Actuals]=0,Main[Remaining forecast],Main[Remaining Sales])

 

Result should look like this:

vcazhengmsft_0-1637570819517.png

 

Attached the pbix file as reference.

 

Best Regards,

Community Support Team _ Caiyun

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If you still have problems on it or I misunderstand your needs, please feel free to let us know. Thanks a lot!

 

 

View solution in original post

3 REPLIES 3
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous 

 

Please try to use this formula to calculate your Remaining Forecast.

Remaining forecast =

VAR selectValue =

    IF ( Main[Actuals] = 0, Main[Forecast], INT ( BLANK () ) )

RETURN

    selectValue

 

After that, use this Calculated column to combine sales and forecast.

CombiningValues = IF(Main[Actuals]=0,Main[Remaining forecast],Main[Remaining Sales])

 

Result should look like this:

vcazhengmsft_0-1637570819517.png

 

Attached the pbix file as reference.

 

Best Regards,

Community Support Team _ Caiyun

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If you still have problems on it or I misunderstand your needs, please feel free to let us know. Thanks a lot!

 

 

HotChilli
Super User
Super User

"I am trying to get the actuals and forecast into one column" It looks like you've still got them in 2 columns.

--

If you're keeping 2 columns and the problem is that there is no total for the Remaining Forecast calculated column, check that you have the correct datatype and check that the summarization is Sum on the column.

amitchandak
Super User
Super User

@Anonymous , Try like

sumx(values(Date[financial Date]), IF ( [Actuals] = 0, [Forecast], BLANK ()) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.