Forum Discussion
pkilo
9 years agoFrequent Visitor
Incorrect Row Totals (previous day/week/year data)
I need a calculated column, which brings the sales from the previous week (same workday) = Sales 7 days ago Date Column1 Column2 Column3 Sales Sales 7days ago 3.1.2017 Jacket RRPT ...
- Anonymous9 years ago
Hi pkilo,
I think you should add a condition to filter with type :Sales & days ago= var currType= LASTNONBLANK(Table[Column3],[Column3]) reuturn CALCULATE(SUM('Table'[Sales]),FILTER(All('Table'),Table[Date]=MAX([Date])-7&&[Column3]=currType))Regards,
Xiaoxin Sheng
- pkilo9 years agoFrequent Visitor
I use this one:
Sales 7 days ago = CALCULATE(SUM('Table'[Sales]);FILTER(('Table');(DATEADD('Table'[Date]; -7; DAY))) )
- hohlick9 years ago
Continued Contributor
try this (didn't checked):
Sales 7 days ago = CALCULATE ( SUM ( 'Table'[Sales] ); FILTER ( ALL ( 'Table'[Date]; 'Table'[Sales] ); DATEADD ( 'Table'[Date]; -7; DAY ) ) )- pkilo9 years agoFrequent Visitor
It change the value, but was not what I expected.
Kind of weird - it brings the sales value from the same row, not the 7 days ago value. And for some rows it brings nothing.
But it wasn't the Total anymore.