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

Slicer used to select end date for rolling 12 weeks

Hey guys,

 

I'm trying to use a slicer so that when I select a week (say week 50), the data in a graph shows everything for the last 12 weeks ending on week 50. I can't use the relative slicer function because I need the slicer to be in the select individual weeks format. Thanks

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

Please check out the demo in the attachment.

1. Create a new date table. Because the dates will be filter out by the slicer which is from the same table. 

2. Don't create any relationship with other table. 

3. Modify the measure below.

Measure 2 =
VAR minDate =
    FIRSTDATE ( DATESINPERIOD ( 'Table1'[Date], MAX ( 'Table1'[Date] ), -84, DAY ) )
RETURN
    IF (
        MIN ( 'Table 2'[Date] ) < minDate
            || MIN ( 'Table 2'[Date] ) > MAX ( 'Table1'[Date] ),
        BLANK (),
        SUM ( 'Table 2'[Value] )
    )

Best Regards,

Dale

Community Support Team _ Dale
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

1 REPLY 1
v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

Please check out the demo in the attachment.

1. Create a new date table. Because the dates will be filter out by the slicer which is from the same table. 

2. Don't create any relationship with other table. 

3. Modify the measure below.

Measure 2 =
VAR minDate =
    FIRSTDATE ( DATESINPERIOD ( 'Table1'[Date], MAX ( 'Table1'[Date] ), -84, DAY ) )
RETURN
    IF (
        MIN ( 'Table 2'[Date] ) < minDate
            || MIN ( 'Table 2'[Date] ) > MAX ( 'Table1'[Date] ),
        BLANK (),
        SUM ( 'Table 2'[Value] )
    )

Best Regards,

Dale

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

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.