Forum Discussion
Anonymous
7 years agoNot applicable
Nested IF statement dates
Hi, I am trying to get the most recent date from 2 columns. If the result date is in 2018 then it must be transformed to 1-1-2019. this part to transform from 2018 to 2019 is where i get stuck. ...
- 7 years ago
Anonymous hi,
Create one calculated column.
please change my columns name with yours.
""
CC =
var max_date= IF([Colum 1]>[Colum 2] , [Colum 1] , [Colum 2])
var upd_date = IF(YEAR(max_date) < 2019 || max_date = null , DATE(2019,1,1) , max_date)
return
upd_date
""
Regards,
Novil
- 7 years ago
Replace NULL with BLANK()
Remove the .Date from the date columns.
tex628
7 years agoCommunity Champion
Create two calculated columns:
Column1 = IF([Startdate]>[Real Startdate] , [StartDate] , [Real Startdate])
Column2 = IF(YEAR([Column1]) < 2019 || [Column1] = null , DATE(2019,1,1) , [Column1])
Column2 should give you the result you are looking for.
- Anonymous7 years agoNot applicable
Power BI displays an error: Operator or expression NULL is not supported in this context.
- tex6287 years agoCommunity Champion
Are your columns in date-format?
- Anonymous7 years agoNot applicable
yes converted from date/time to date, but in format: monday 31 december 2018.
Turned into 31-12-2018 but same error.
if a cell is empty there isn't anything in it. there isn't a null value. its empty.