Forum Discussion
MarkCBB
Helper V
8 years ago2nd last date per item
Hi there, I need to create a measure that filters another measure to the 2nd last date. for example, For BP Charles I would like the measure to return the 41.2% score as it is the 2nd last score...
- 8 years ago
Hi Mark MarkCBB
Please try this MEASURE
Measure = VAR SecondLastDate = MINX ( TOPN ( 2, CALCULATETABLE ( VALUES ( TableName[DATE] ), ALLEXCEPT ( TableName, TableName[STORE] ) ), TableName[DATE], DESC ), TableName[DATE] ) RETURN CALCULATE ( [TotalAverageScore], FILTER ( ALLEXCEPT ( TableName, TableName[STORE] ), TableName[DATE] = SecondLastDate ) )
MarkCBB
Helper V
8 years agoZubair_Muhammad, Thank you so much for your help, I have learnt something new.
Quick question, would there be any performance difference between the 2 approaches?
Zubair_Muhammad
Community Champion
8 years ago