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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
mike_I
New Member

Cumulative Totals - exclude most recent months values

I am plotting cumulative actuals against a forecast. However,  I only want to plot the actual results up until  the previous month we have actuals for. This excludes issues with having partial months actuals. So if for example  our most recent actual result  was on the 1st of April 2018, I only want include  results up  until  March 2018.

 

I am able to create the base plot (see screenshot below), but I can't figure out how to exclude the most recent month (April).n.PNG

 

 

Here is my code,

 

Cumulative Actuals_forum3 = IF( LASTDATE( 'DateDim'[Date]) > [Max Month with Actuals],
    BLANK(),
        CALCULATE(( Detailed_Breakdown[Actuals.]),
            FILTER( ALLSELECTED( 'DateDim' ), 
                'DateDim'[Date] <= MAX( 'DateDim'[Date])))

 )

 

 I would have though that I could have subtracted one month from the  [Max month with Actuals]  measure- but that doesn't work.  Here is my Measure that subrtacts one month 

Max Month with Actuals - 1 month = EDATE([Max Month with Actuals],-1)

Any ideas or suggestions would be welcome. 

 

Demo file here 

 

Cheers !

 

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

@mike_I,

 

You may try to change it as follows.

IF (
    LASTDATE ( 'DateDim'[Date] )
        >= CALCULATE ( [Max Month with Actuals], ALLSELECTED ( 'DateDim'[Date] ) ),
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@mike_I,

 

You may try to change it as follows.

IF (
    LASTDATE ( 'DateDim'[Date] )
        >= CALCULATE ( [Max Month with Actuals], ALLSELECTED ( 'DateDim'[Date] ) ),
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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