PowerPivot calculated item: calculate only for prior months

cr731

Well-known Member
Joined
Sep 17, 2010
Messages
611
I have a calculated field in my PowerPivot model that takes Actuals minus Budget to equal Variance. This value is displayed by month. However, when the month is in the future, I don't want this to show anything because it's not valid to subtract a zero Actuals when there are no Actuals yet.

I'm drawing a blank on how to accomplish this.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Can you try this formula?

Code:
IF (
    [date] > TODAY ()
        || (
            MONTH ( [date] ) = MONTH ( TODAY () )
            && YEAR ( [date] ) = YEAR ( TODAY () )
        ),
    BLANK (),
    [actuals] - [budget]
)

Let me know if it helps.

Olivier.
 
Upvote 0
Can you try this formula?

Code:
IF (
    [date] > TODAY ()
        || (
            MONTH ( [date] ) = MONTH ( TODAY () )
            && YEAR ( [date] ) = YEAR ( TODAY () )
        ),
    BLANK (),
    [actuals] - [budget]
)

Let me know if it helps.

Olivier.

I get an error that "The value for 'Period' cannot be determined. Either 'Period' doesn't exist, or there is no current row for a column named 'Period'."

('Period' refers to the "date" column, and contains date values)
 
Upvote 0

Forum statistics

Threads
1,224,144
Messages
6,176,648
Members
452,739
Latest member
SCEducator

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top