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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
hkpowerbi
Regular Visitor

Help with formula "Actuals" vs "Forecasts"

Hi All,

 

I've been stuck on something and would appreciate if someone could have a look and help.

I want to create a clustered column chart that shows Actual vs Forecast amounts. However, I want it to ONLY show Actual OR Forecast with the following condition:

 

If actual amount exists for a given month, show me a bar that shows the actual amount

If actual does NOT exist (no data), then show me a bar that shows the forecast for that given month.

 

Let's assume the fields are: Table1[Actual Amount] and Table1[Forecast Amount], and the month field is Table1[Month]

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

If you want a single measure, I would do something like:

 

Actual or Forecast := 
   VAR Act = SUM(Table1[Actual Amount])

   RETURN
         IF (Act, Act, SUM(Table1[Forecast Amount]))

 

If you want 2 measures... with forecast returning blank if there is an actual...

 

Actual := SUM(Table1[Actual Amount])

Forecast := IF ([Actual], BLANK(), SUM(Table1[Forecast Amount]))

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

If you want a single measure, I would do something like:

 

Actual or Forecast := 
   VAR Act = SUM(Table1[Actual Amount])

   RETURN
         IF (Act, Act, SUM(Table1[Forecast Amount]))

 

If you want 2 measures... with forecast returning blank if there is an actual...

 

Actual := SUM(Table1[Actual Amount])

Forecast := IF ([Actual], BLANK(), SUM(Table1[Forecast Amount]))

 

Wow your solution totally works. One more question now (I'm getting greedy haha!):

 

I have plotted actuals and forecasts for 12 months in the chart...is there a way to automatically draw some sort of a line in between where actuals end and forecasts begin?

Anonymous
Not applicable

Now you have gone beyond my skillz.  I just write fancy DAX formulas 🙂

 

LOL, what you have provided me has helped a whole bunch. Much appreciated! Thank you

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.