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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Sdd15c
New Member

Dynamic 4-Week Lookback from One Date Slicer

Hi! I’m trying to make 4 visual tables on one page show metrics for different weeks with the dates being controlled by on slicer.

My fact table is related to my date table through the Reporting Date column, and that Reporting Date is always a Monday (the day the weekly report is pulled).

 

I want to use a slicer where, when I select a specific Monday:

Visual Table 1 displays metrics for that selected week.

Visual Table 2 automatically displays metrics for the week immediately before it (selected week − 7 days).

Visual Table 3 displays metrics for two weeks prior (selected week − 14 days).

Visual Table 4 displays metrics for three weeks prior (selected week − 21 days).

 

When the slicer selection changes, the “current week” table should update to the newly selected week, and each subsequent table should automatically shift relative to that new selection.

 

All tables have the same measures. Is this possible?

3 ACCEPTED SOLUTIONS
Xian-Zuo
Frequent Visitor

It's possible.

The scenario you describe is essentially a kind of time intelligence, which can be achieved through measurement values ​​and calculation groups.
like this.

XianZuo_0-1772178310832.png

Measure = MIN('dim_date'[date])&"~"&MAX('dim_date'[date])
Measure - 7 day = CALCULATE(
    [Measure]
    ,DATEADD('dim_date'[date],-7,DAY)
)
Measure - 14 day = CALCULATE(
    [Measure]
    ,DATEADD('dim_date'[date],-14,DAY)
)
Measure - 21 day = CALCULATE(
    [Measure]
    ,DATEADD('dim_date'[date],-21,DAY)
)

Another way is to write code in a calculation group that can be applied to different measures, which looks like different slicers are used

XianZuo_1-1772178594325.png

 

View solution in original post

cengizhanarslan
Super User
Super User

Step 1) Capture the selected Monday

Selected Week =
SELECTEDVALUE('Date'[Date])

Make sure:

  • Your slicer is single-select

  • It uses the Date table (not the fact table)

 

Step 2) Create offset measures

Metric – Week 0 =
VAR SelectedMonday = [Selected Week]
RETURN
CALCULATE(
    [Your Metric],
    'Date'[Date] = SelectedMonday
)

Metric – Week -1 =
VAR SelectedMonday = [Selected Week]
RETURN
CALCULATE(
    [Your Metric],
    'Date'[Date] = SelectedMonday - 7
)

Metric – Week -2 =
VAR SelectedMonday = [Selected Week]
RETURN
CALCULATE(
    [Your Metric],
    'Date'[Date] = SelectedMonday - 14
)

Metric – Week -3 =
VAR SelectedMonday = [Selected Week]
RETURN
CALCULATE(
    [Your Metric],
    'Date'[Date] = SelectedMonday - 21
)

 

Step 3) Use the correct measure in each table

Table 1 → use Metric – Week 0

Table 2 → use Metric – Week -1

Table 3 → use Metric – Week -2

Table 4 → use Metric – Week -3

Each visual now automatically shifts relative to the slicer selection.

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.

View solution in original post

Ray_Minds
Solution Supplier
Solution Supplier

Please find the below steps to achieve that 
Fact Table

image.png

Date Dimension Table 

image.png

image.pngimage.png

Hence, All values matching as per source data 

We can also make it dynamic within a single measure – Please feel free to let us know if you need any help around that 

View solution in original post

8 REPLIES 8
v-veshwara-msft
Community Support
Community Support

Hi @Sdd15c ,

We wanted to kindly follow up regarding your query. If you need any further assistance, please reach out.
Thank you.

v-veshwara-msft
Community Support
Community Support

Hi @Sdd15c ,
Thanks for reaching out to Microsoft Fabric Community.

 

Just wanted to check if the responses provided were helpful. If further assistance is needed, please reach out.
Thank you.

Ray_Minds
Solution Supplier
Solution Supplier

Please find the below steps to achieve that 
Fact Table

image.png

Date Dimension Table 

image.png

image.pngimage.png

Hence, All values matching as per source data 

We can also make it dynamic within a single measure – Please feel free to let us know if you need any help around that 

Thank you!! 

cengizhanarslan
Super User
Super User

Step 1) Capture the selected Monday

Selected Week =
SELECTEDVALUE('Date'[Date])

Make sure:

  • Your slicer is single-select

  • It uses the Date table (not the fact table)

 

Step 2) Create offset measures

Metric – Week 0 =
VAR SelectedMonday = [Selected Week]
RETURN
CALCULATE(
    [Your Metric],
    'Date'[Date] = SelectedMonday
)

Metric – Week -1 =
VAR SelectedMonday = [Selected Week]
RETURN
CALCULATE(
    [Your Metric],
    'Date'[Date] = SelectedMonday - 7
)

Metric – Week -2 =
VAR SelectedMonday = [Selected Week]
RETURN
CALCULATE(
    [Your Metric],
    'Date'[Date] = SelectedMonday - 14
)

Metric – Week -3 =
VAR SelectedMonday = [Selected Week]
RETURN
CALCULATE(
    [Your Metric],
    'Date'[Date] = SelectedMonday - 21
)

 

Step 3) Use the correct measure in each table

Table 1 → use Metric – Week 0

Table 2 → use Metric – Week -1

Table 3 → use Metric – Week -2

Table 4 → use Metric – Week -3

Each visual now automatically shifts relative to the slicer selection.

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.

Thank you!! 

Xian-Zuo
Frequent Visitor

It's possible.

The scenario you describe is essentially a kind of time intelligence, which can be achieved through measurement values ​​and calculation groups.
like this.

XianZuo_0-1772178310832.png

Measure = MIN('dim_date'[date])&"~"&MAX('dim_date'[date])
Measure - 7 day = CALCULATE(
    [Measure]
    ,DATEADD('dim_date'[date],-7,DAY)
)
Measure - 14 day = CALCULATE(
    [Measure]
    ,DATEADD('dim_date'[date],-14,DAY)
)
Measure - 21 day = CALCULATE(
    [Measure]
    ,DATEADD('dim_date'[date],-21,DAY)
)

Another way is to write code in a calculation group that can be applied to different measures, which looks like different slicers are used

XianZuo_1-1772178594325.png

 

Thank you!! 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.