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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bjoshi
Resolver I
Resolver I

Shifting down Cumulative Total by one row

I have created a calculated column 'CumulativeTotalColumn' using this dax formula:

 

CumulativeTotalColumn = 
var rowdate = Journals[JournalDate] 
Return
   CALCULATE(
    SUM(Journals[Total]),
     FILTER(
        'Journals',
        'Journals'[JournalDate]<= rowdate)
     )

 The result:
shift.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Now, I need another calculated column, 'CalculatedTotalColumnShifted' that shifts the 'CumulativeTotalColumn'  down by one row. i.e. 1st March 2016 has the CumulativeTotal of 29 Feb, 2nd March has the Cumulative Total of 1st March and so on.

 

Any ideas?

 

Thank You

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@bjoshi

 

Hi, you can obtain with this

 

CumulativeTotalColumnShifted = 
var rowdate = Journals[JournalDate] 
Return
   CALCULATE(
    SUM(Journals[Total]),
     FILTER(
        'Journals',
        'Journals'[JournalDate]< rowdate)
     )

 

 




Lima - Peru

View solution in original post

2 REPLIES 2
Vvelarde
Community Champion
Community Champion

@bjoshi

 

Hi, you can obtain with this

 

CumulativeTotalColumnShifted = 
var rowdate = Journals[JournalDate] 
Return
   CALCULATE(
    SUM(Journals[Total]),
     FILTER(
        'Journals',
        'Journals'[JournalDate]< rowdate)
     )

 

 




Lima - Peru

@Vvelarde. Wow, I didn't realize that. I am very new to DAX.  But, glad that the community members are very helpful.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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