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
Anonymous
Not applicable

No correct data in column dateadd

Hello,

 

I tried to use the Dateadd function but on some row I get no dates. Can you help me to find the problem?

Q1.png

 
 
 
 
 
 
 
 
 
 
 
 
This is the dax I used to calculate the previous month:
 
Vervaldatum opzegtermijn = DATEADD(Contracten[einddatum];-1;MONTH)
 
Any ideas?

 

 

 

 

 

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

The DATEADD function requires contiguous date selections , while your date is intermittent.

 

To work around the issue, you can create a calendar table using DAX below.

 

Calendar = CALENDAR(MIN(Table1[End date]),MAX(Table1[End date]))  

 

Or

 

Calendar =CALENDARAUTO()

 

Then you can create column in your original table.

 

Column1= DATEADD(Calendar[Date],-1,MONTH)

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-xicai
Community Support
Community Support

Hi  @Anonymous  ,

 

Does that make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not,  let me know and I'll try to help you further.

 

Best regards

Amy

v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

The DATEADD function requires contiguous date selections , while your date is intermittent.

 

To work around the issue, you can create a calendar table using DAX below.

 

Calendar = CALENDAR(MIN(Table1[End date]),MAX(Table1[End date]))  

 

Or

 

Calendar =CALENDARAUTO()

 

Then you can create column in your original table.

 

Column1= DATEADD(Calendar[Date],-1,MONTH)

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

Please correct the date format. Below datatype, you have the format option. The date is in the DD-MM-YY format. That is not detected as date  yet in the model.

Anonymous
Not applicable

Hi,

 

The date format is on both columns the same. Still not all the fields have a date.

 

Q1.png

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.