Forum Discussion
Anonymous
6 years agoNot applicable
Prior Date
I have a table with jobs records by customer and work date...I have the max work date...how do I get the prior work date?
Hi Anonymous ,
Does the measure meet your requirement?
Prior Date = VAR maxd = MAXX ( ALL ( 'Table' ), 'Table'[work day] ) RETURN CALCULATE ( MAX ( 'Table'[work day] ), FILTER ( 'Table', 'Table'[work day] <> maxd ) )
4 Replies
- v-frfei-msftCommunity Support
Hi Anonymous ,
Does the measure meet your requirement?
Prior Date = VAR maxd = MAXX ( ALL ( 'Table' ), 'Table'[work day] ) RETURN CALCULATE ( MAX ( 'Table'[work day] ), FILTER ( 'Table', 'Table'[work day] <> maxd ) )- AnonymousNot applicable
This is great...thx!!! One more follow-up question...how do I get the sales from that prior date now that I have it?
- v-frfei-msftCommunity Support
Hi Anonymous ,
Then we should update the measure as below.
Prior Date = VAR maxd = MAXX ( ALL ( 'Table' ), 'Table'[work day] ) RETURN CALCULATE ( MAX ( 'Table'[work day] ), FILTER ( ALL('Table'), 'Table'[work day] <> maxd ) )To get the sales amount based on Prior date.
sales amount pri = CALCULATE(SUM('Table'[sales]),FILTER('Table','Table'[work day] = [Prior Date]))