cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MartinVollaard Frequent Visitor
Frequent Visitor

Getting the sum of the previous datetime value in report

Hi All,

 

What I need is a column with the numbers per date (that I have). In column 2 I'm looking for the value of the previous datetime. See column "Needed".

 2018-01-23 16_51_43-.png

 

For previous I use now:

CALCULATE(SUM(OutputSQL[OMZET]);FILTER(ALL(OutputSQL[PEILDATUM]); OutputSQL[PEILDATUM] < MAX(OutputSQL[PEILDATUM])))

 

I know I add up the numbers less than the date but I don't know how to use only the previous date. I've tried EARLIER but got stuck.

 

Any directions?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Getting the sum of the previous datetime value in report

@MartinVollaard,

 

You may add an index column in Query Editor, then use DAX below to add a calculated column.

Column =
LOOKUPVALUE ( OutputSQL[OMZET], OutputSQL[Index], OutputSQL[Index] - 1 )
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.
3 REPLIES 3
MartinVollaard Frequent Visitor
Frequent Visitor

Re: Getting the sum of the previous datetime value in report

I’m sorry but forgot to mention that my datetime column contains all the mentioned values. They are nog unique. In Total there are more than 4000 records.

Community Support Team
Community Support Team

Re: Getting the sum of the previous datetime value in report

@MartinVollaard,

 

You may add an index column in Query Editor, then use DAX below to add a calculated column.

Column =
LOOKUPVALUE ( OutputSQL[OMZET], OutputSQL[Index], OutputSQL[Index] - 1 )
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.
Highlighted
MartinVollaard Frequent Visitor
Frequent Visitor

Re: Getting the sum of the previous datetime value in report

Thanks, Indexing did the trick.