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
salman_ali
Helper IV
Helper IV

adding dates

Hello,

 

salman_ali_0-1603465806162.png

if date is 7 days ago, I would like to add 7 days to today's date

if date is 6 days ago, I would like to add 6 days to today's date

so on and so forth

if date is today, then leave it as is 

otherwise blank 

 

but my formula doesn't work, 

it gives me blanks or today's date 

 

reasons?

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @salman_ali ,

 

Refer to this:

next_date = var diff = DATEDIFF('Table'[date],TODAY(),DAY)
return IF(diff>=0&&diff<=7,TODAY()+diff,BLANK())

V-lianl-msft_0-1603768267612.png

 

 

Best Regards,
Liang
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

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @salman_ali ,

 

Refer to this:

next_date = var diff = DATEDIFF('Table'[date],TODAY(),DAY)
return IF(diff>=0&&diff<=7,TODAY()+diff,BLANK())

V-lianl-msft_0-1603768267612.png

 

 

Best Regards,
Liang
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

@salman_ali , Seem like a new column like

Switch( True() ,
Query[Event Date] >= today() -7 && Query[Event Date] <=today() , today(),
blank()
)

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.