Forum Discussion
DAX DATEADD Contagious issue
I am trying to create a date add formula for datetime value in Power BI. The Power BI is linked to Analysis Service. My measure is DateAdd('Table1'[DateField],1,MONTH) I receive the folowing error The report measure has a syntax or semantic error at line 1, postion 2, reported by Analysis Sercices 'Function DATEADD' expects a contagious selection when the date columns is not unique, has gaps or contains a time portion. Can anyone help?
3 Replies
- amitchandak
Super User
Anonymous , yes Dateadd needs a continuous date. so if you do not have those you will get error
Try like this to use date as date add
date(year('Table1'[DateField]),month('Table1'[DateField])-1,day('Table1'[DateField]))
- AnonymousNot applicable
Thank. I just tried this but it still did not work as it couldn't find the dates because they were not measures.
- amitchandak
Super User
Anonymous , See if this can help
https://www.dropbox.com/s/bi2guw0x9awzvm2/DateAsDate%20Add.pbix?dl=0
Can you share sample data and sample output in a table format? Or a sample pbix after removing sensitive data.