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
RNightscape
Frequent Visitor

DATEADD works for some cells.

Hi all, 

I'm try to filter to create a measure and It will do a Dateadd (days) on my start column.

The strannge it's because depends the filter I use, works for some model and not for others....  How  Could I resolve this?

 

 

 

IMG_1.pngIMG_2.pngIMG_3.pngIMG_4.png

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @RNightscape

As tested and disscussed widely, it is impossible to use dateadd in a measure in this way, i would suggest you to use "+" function direactly.

Please see my test for example.

create a new table with week and days to the week as below.

12.png

this table should have no relationship with your data table.

Then create a measure

Measure 2 = SELECTEDVALUE(Sheet5[start])+SELECTEDVALUE(Table1[week])*7

11.png 

View solution in original post

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @RNightscape

As tested and disscussed widely, it is impossible to use dateadd in a measure in this way, i would suggest you to use "+" function direactly.

Please see my test for example.

create a new table with week and days to the week as below.

12.png

this table should have no relationship with your data table.

Then create a measure

Measure 2 = SELECTEDVALUE(Sheet5[start])+SELECTEDVALUE(Table1[week])*7

11.png 

@v-juanli-msft  Thank you very much by your help!

v-juanli-msft
Community Support
Community Support

Hi @RNightscape

I can't create such measure to get "dateadd" measure displaying on the table visual as yours. When i use the following measure and add it in the table visual, it will return an error.

Measure 4 = DATEADD(Sheet5[start],1,DAY)

Could you tell me how to you calculate the "Test" measure?

 

Below is my test with function "dateadd" which would explain for why some value would not show.

As tesed, when the "date" column is not continuous,"dateadd" function doesn't return any value.

12.png

With continuous dates, it could return the dates which can be found in your "date" column,

for example, in the following table, "DATEADD" function should  return 2018/1/5 for the last row, but  2018/1/5 can't be found in the "Column1", so it returns blank actually.

10.png

 

The problem above can be solved by the following formula.

11.png

Hi @v-juanli-msft, really thanks by your help.

 

I calculated using this.

 

powerbi.png

 

 

 

I tried to populate ".[DATE]" but isn't worked well.

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.