Forum Discussion
nextday function not working with edate and eomonth functions
I was reading through SQLBI instruction that had a line: NEXTDAY ( SAMEPERIODLASTYEAR ( LASTDATE ( Calendar[FullDate] ) ) )
So being unimaginitive, as I am, I tried NEXTDAY ( EDATE( LASTDATE(fact[date]), -13 ) ) ) and NEXTDAY ( EOMONTH( LASTDATE(fact[date]), -13 ) ) ). By taking out nextday I get a result, but with Nextday() I get a "A function 'LASTDATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed." Why do I get this? Why isn't nextday() allowed?
EDATE https://docs.microsoft.com/en-us/dax/edate-function-dax or EOMONTH https://docs.microsoft.com/en-us/dax/eomonth-function-dax returns the DATE. well. like a string in text format
but for NEXTDAY https://docs.microsoft.com/en-us/dax/nextday-function-dax input is A column containing dates.
It is not so clear but there is a difference
do not hesitate to give a kudo to useful posts and mark solutions as solution
3 Replies
- az38
Community Champion
maybe that will be enough?
Column = Edate(lastdate(fact[date]),-13)+1do not hesitate to give a kudo to useful posts and mark solutions as solution
- GoingIncognito
Advocate III
That's what I did. But didn't come with a better place to ask, why doesn't nextday() work here? I would like to know, out of curiosity. Thank you for your reply!
- az38
Community Champion
EDATE https://docs.microsoft.com/en-us/dax/edate-function-dax or EOMONTH https://docs.microsoft.com/en-us/dax/eomonth-function-dax returns the DATE. well. like a string in text format
but for NEXTDAY https://docs.microsoft.com/en-us/dax/nextday-function-dax input is A column containing dates.
It is not so clear but there is a difference
do not hesitate to give a kudo to useful posts and mark solutions as solution