Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi everyone,
I'm trying to set a default values to a slicer -
The field inside the slicer is in the format of "YEAR.WW" and the data type is a decimal number.
By default - the current values of the slicer is from 2020.17 to 2020.35 (I don't know why).
I want the default values to be the last 8 weeks (relative to current week & dynemicly changing every week).
I Know that it can be done by using a date field and choosing the "relative" option, but then - I didn't found a way to play with the range (for example - if I want to slice from 2020.12 to 2020.18).
Is there any way to do it?
Thanks.
Solved! Go to Solution.
@saharmal
You can add a column to your table to convert the YYYY.WW to relevant week ending dates and use the date column on the slicer to set Past 8 Week filter.
Date =
var year = INT(Table6[YYYY.WW])
var week = (Table6[YYYY.WW] - year) * 100
return
DATE(year,1,-2)-WEEKDAY(DATE(year,1,3))+week*7________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi @saharmal ,
You may create a measure to judge if the the week is in last 8 weeks and add this measure to visual filter.
Measure =
var currentweek = YEAR(TODAY())&WEEKNUM(TODAY(),2)
return
IF(SELECTEDVALUE('Table'[year.week])+0>currentweek-8&&SELECTEDVALUE('Table'[year.week])<=currentweek-0,1,0)
Best Regards,
Jay
@saharmal
You can add a column to your table to convert the YYYY.WW to relevant week ending dates and use the date column on the slicer to set Past 8 Week filter.
Date =
var year = INT(Table6[YYYY.WW])
var week = (Table6[YYYY.WW] - year) * 100
return
DATE(year,1,-2)-WEEKDAY(DATE(year,1,3))+week*7________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 79 | |
| 38 | |
| 31 | |
| 27 | |
| 27 |