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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
system243trd
Helper I
Helper I

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 3
amitchandak
Super User
Super User

@system243trd , 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]))

 

https://www.youtube.com/watch?v=YWo-ZpKM6gU

Thank.  I just tried this but it still did not work as it couldn't find the dates because they were not measures.

@system243trd , 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.

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.