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
MartinVollaard
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
v-chuncz-msft
Community Support
Community Support

@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.

View solution in original post

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@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.

Thanks, Indexing did the trick.

MartinVollaard
Frequent Visitor

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.

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.

Top Solution Authors