Forum Discussion
New_be
6 years agoHelper V
Read previous rows from dates
Hi everyone! Im still new in power bi. Currently working on this project where i need to show the date for yesterday. For example in the image, if my date is 22/5/2020 (friday), i need to get t...
- 6 years ago
Try this
Column = VAR _PreviousDay = MAXX ( FILTER ( MyTable, MyTable[Date] < EARLIER ( MyTable[Date] ) && MyTable[Status] <> "OFF" ), MyTable[Date] ) VAR _result = SUMX ( FILTER ( MyTable, MyTable[Date] < EARLIER ( MyTable[Date] ) && MyTable[Date] >= _PreviousDay ), MyTable[Cost] ) RETURN _result
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
amitchandak
6 years agoSuper User
New_be , Two new columns like that.
Work Date = if(WEEKDAY([Date],2)>=6,BLANK(),[Date]) //OR
Work Date = if([Status]="OFF",BLANK(),[Date])
Last working date = maxx(filter('Date','Date'[Work Date]<EARLIER('Date'[Work Date])),'Date'[Work Date])