Forum Discussion

JOKA's avatar
JOKA
Icon for Advocate I rankAdvocate I
6 years ago

Rolling 12 months issue

Hi!

 

I´m struggling to create a new measure that shows the sum of the last 12 months. I would be very grateful if someone could help.

 

This is the problem:

 

- I have the measure "Execution" from the dataset (excel). It is the cummulative sum in the fiscal year (July to June). 

 

- In Power BI I created a new measure called "Execution" that calculates the execution for each month:

Execution = CALCULATE([Execution]-[Previous Month Execution])
Where:
Previous Month Execution = CALCULATE([Execution];PREVIOUSMONTH('Date'[Date]);'Date'[Month]<>"June")
 
All of this is correct. But now I need to show the sum of the last 12 month of Execution. For doing that in Power BI I created a new measure called "L12M" using this formula:
L12M = CALCULATE (
[Execution];
DATESBETWEEN (
'Date'[Date];
NEXTDAY ( SAMEPERIODLASTYEAR ( LASTDATE ('Date'[Date]) ) );
LASTDATE ( 'Date'[Date])
)
)
 
But instead of the sum of Execution, it is showing the sum of cummulated Execution.
Does anyone know what I am doing wrong?
 
Thank you so much for your help!!!

3 Replies

  • kentyler's avatar
    kentyler
    Icon for Solution Sage rankSolution Sage

    Have you considered trying something like PARALLELPERIOD() or PREVIOUSMONTH()

    • JOKA's avatar
      JOKA
      Icon for Advocate I rankAdvocate I

      Thank you for your reply!

       

      Not sure what you mean. Could you be more specific?

      I have already used PREVIOUSMONTH

       

       

  • Hi,

    Please explain the business question, share some data (in a format that can be pasted in MS Excel or share the download link of the PBI file) and also show the expected result.