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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
refint650
Helper III
Helper III

Prior day(Calendar date)

Hello 

 

I have calendar date slicer having values for current month  Sample value Calendar date : 2021-06-18'. when user selects value how can i write expression to get prior 7th day value from calendardate data.?

 

If selected value is 2021-06-18.  2nd calculated column should return 2021-06-11..

 

Thanks

Ref

1 ACCEPTED SOLUTION

Hi @refint650 ,

 

For measure you can use:

 

Last 7 days = MAX(Calendar[Date])-7

 

For calculated column:

 

Last 7 days = Calendar[Date]-7

 

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

 

Best Regards,

Dedmon Dai

View solution in original post

3 REPLIES 3
refint650
Helper III
Helper III

Let me try syntax, thanks

Hi @refint650 ,

 

For measure you can use:

 

Last 7 days = MAX(Calendar[Date])-7

 

For calculated column:

 

Last 7 days = Calendar[Date]-7

 

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

 

Best Regards,

Dedmon Dai

HashamNiaz
Solution Sage
Solution Sage

Hi @refint650 !

 

You can use following DAX to create a measure to return Date value prior 7 days of selected date value;

 

Last 7 Date = CALCULATE(MIN('Calendar'[Date]), DATEADD('Calendar'[Date], -7, DAY))

 

Regards,

Hasham

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.