Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
GoingIncognito
Advocate III
Advocate III

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? 

1 ACCEPTED SOLUTION

@GoingIncognito 

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


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

3 REPLIES 3
az38
Community Champion
Community Champion

hi @GoingIncognito 

maybe that will be enough?

Column = Edate(lastdate(fact[date]),-13)+1

do not hesitate to give a kudo to useful posts and mark solutions as solution

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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!

@GoingIncognito 

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


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.