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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
derekmac
Helper I
Helper I

Relative Date Slicer Week only

Hi All

 

Is it possible to lock a Relative Date Slicer to Weeks only rather allow the user to change the period?

derekmac_0-1699523870833.png

And if not is there some other solution to allow the user to toggle for their own choice of weeks only?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @derekmac 
The slicer cannot only choose the week, but maybe you can refer to the follwing solution to substitue it.

Sample data 

vxinruzhumsft_0-1699853074778.png

1.Create a number paramater to set it as last week slicer

vxinruzhumsft_1-1699853115411.png

 

2.Then create a measure

Measure = 
VAR a =
    SELECTEDVALUE ( Parameter[Parameter] )
VAR b =
    MAXX ( ALLSELECTED ( 'Table 2'[Date] ), [Date] ) - 7 * a + 1
RETURN
    IF (
        SELECTEDVALUE ( 'Table 2'[Date] ) >= b
            && SELECTEDVALUE ( 'Table 2'[Date] )
                <= MAXX ( ALLSELECTED ( 'Table 2'[Date] ), [Date] ),
        1,
        0
    )

3.Then you can create a visual and put the data to the visual, then put the measure to the visual filter(e.g table visual)

vxinruzhumsft_2-1699853609140.png

 

Output

vxinruzhumsft_3-1699853680386.png

 

vxinruzhumsft_4-1699853693723.png

 

 

Best Regards!

Yolo Zhu

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
Villezekeviking
Most Valuable Professional
Most Valuable Professional

I now this is already solved but I'm offering an alternative solution for those who might search and find this thread.

 

https://www.villezekeviking.com/dax-tables-calendar-and-time/

 

I have offset-columns from today that can be used to filter any report relative from today on days, weeks, months, quarters or years.

Unlike the relative date filtering, this can span any period, from historical data, over current periods and into the future.

Anonymous
Not applicable

Hi @derekmac 
The slicer cannot only choose the week, but maybe you can refer to the follwing solution to substitue it.

Sample data 

vxinruzhumsft_0-1699853074778.png

1.Create a number paramater to set it as last week slicer

vxinruzhumsft_1-1699853115411.png

 

2.Then create a measure

Measure = 
VAR a =
    SELECTEDVALUE ( Parameter[Parameter] )
VAR b =
    MAXX ( ALLSELECTED ( 'Table 2'[Date] ), [Date] ) - 7 * a + 1
RETURN
    IF (
        SELECTEDVALUE ( 'Table 2'[Date] ) >= b
            && SELECTEDVALUE ( 'Table 2'[Date] )
                <= MAXX ( ALLSELECTED ( 'Table 2'[Date] ), [Date] ),
        1,
        0
    )

3.Then you can create a visual and put the data to the visual, then put the measure to the visual filter(e.g table visual)

vxinruzhumsft_2-1699853609140.png

 

Output

vxinruzhumsft_3-1699853680386.png

 

vxinruzhumsft_4-1699853693723.png

 

 

Best Regards!

Yolo Zhu

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

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors