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
Highlighted
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.
MartinVollaard Frequent Visitor
Frequent Visitor

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

Thanks, Indexing did the trick.

Helpful resources

Announcements
Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 122 members 1,803 guests
Please welcome our newest community members: