Forum Discussion
AGonza123
5 years agoFrequent Visitor
Formula to compare previous cells
ARRIVAL DATE END DATE 2/3/2021 9/3/2021 15/3/2021 17/3/2021 Hello! I would have a doubt which formula to use to compare previous cells, I want to perform a logica...
- 5 years ago
Hi, AGonza123
Please check the below picture and the measure below, which are for creating a measure.
The link to the sample pbix file is down below.
https://www.dropbox.com/s/6s2vcied9g2blg4/agonza.pbix?dl=0
Result =VAR currentenddate =MAX ( 'Table'[End Date] )VAR enddatepreviousrow =CALCULATE (LASTNONBLANK ( 'Table'[End Date], MAX ( 'Table'[End Date] ) ),FILTER ( ALLSELECTED ( 'Table' ), 'Table'[End Date] < currentenddate ))RETURNIF (ISFILTERED ( 'Table' ),IF (SELECTEDVALUE ( 'Table'[Arrival Date] ) <> BLANK ()&& SELECTEDVALUE ( 'Table'[End Date] ) <> BLANK ()&& enddatepreviousrow <> BLANK (),"ok","verify"))Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
amitchandak
5 years agoSuper User
AGonza123 , You can add an index column and get previous row
last END DATE = maxx(filter(Table,[index] = earlier([index])-1),[END DATE])
you can compare his with end date
https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bisame you can do for another date