Forum Discussion
Anonymous
6 years agoNot applicable
IF Statement help
Good afternoon, Can someone tell me why this is not working? IF ( YEAR( 'Casino Project Feb 2020'[Date] ) = YEAR (LASTDATE('Casino Project Feb 2020'[Date])) && MONTH( 'Casino Project Feb 2020...
- Anonymous6 years ago
Anonymous
This is because lastdate returns the current row, you will need to add All(table) as the context:
Column = var Lastdate_= CALCULATE(LASTDATE('Casino Project Feb 2020'[Date]),ALL('Casino Project Feb 2020')) Return IF(YEAR( 'Casino Project Feb 2020'[Date] ) = YEAR (Lastdate_) && MONTH( 'Casino Project Feb 2020'[Date]) = MONTH (Lastdate_), "Yes","No")Best regards
Paul Zheng
Anonymous
6 years agoNot applicable
Also, the calculated column is returning "yes" for all rows even when it should be "no"