Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Help with Formula DAX

Hello everyone,

I'm needing help from some mind higher than mine to do the following.

I have the following table of percentage inflation values month by month.

Nicopita77_0-1607220279263.png

I need to make a measure that allows me to calculate the cumulative inflation of 12 months but not those of the last month but of two previous years:

I have resolved the cumulative inflation of 12 months back from the selected date of the slicer on the left but I want that of the previous 12 months.

With the following measure create the cumulative inflation of the last 12 months of the selected date in the slicer.

Acum inflation. 12 months - CALCULATE(PRODUCTX('Inflation','Inflation'[Inflation]),DATESINPERIOD(Calendar[Date],LASTDATE(Calendar[Date]), -12,MONTH))-1
The other measure that I can't generate well is the one that gives 124.04% that brings me the accumulator of the 24 months but I want you to bring the first 12 months and be mobile from the date you select in the slicer. This measure I have to correct.
Acum inflation. 24 Months Ant. ? CALCULATE(PRODUCTX('Inflation','Inflation'[Inflation]),DATESINPERIOD(Calendar[Date],LASTDATE(Calendar[Date]), -24,MONTH))-1

Nicopita77_2-1607220583000.png

Thanks for the help!!!

13 Replies

  • Hi,

    Share the link from where i can download your MS Excel file with your formulas so that your calculation logic can be understood.  Also, on another tab in the workbook, please show the expected result in a simple table format.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks Ashish !!! You are the best my friend.

      Here attached the link to download with the . PBIX file and inside it the created measures and the source I'm working.

      https://drive.google.com/file/d/15IGuOfcaRCL6bvdU2mv_N4WGMhZVuj9n/view?usp=sharing


      @Ashish_Mathur wrote:

      Hello

      Share the link from where I can download your MS Excel file with your formulas so you can understand your calculation logic. Also, on another tab of the workbook, display the expected result in a simple table format.



      @Ashish_Mathur wrote:

      Hello

      Share the link from where I can download your MS Excel file with your formulas so you can understand your calculation logic. Also, on another tab of the workbook, display the expected result in a simple table format.


      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

        That is not what i asked you for in my previous post.  Please read my previous post carefully.