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
deb_power123
Helper V
Helper V

How to preselect the checkbox of week number in PowerBI?

Hi All,

 

Is there any available settings or way to handle preselection of the checkboxes in PowerBI?

 

I want the latest WeekNumbers to be always preselected in my visualization. Weeknumber should correspond to the system date.

 

Is there a way to achieve this ,may be using DAX?

 

The one pointed in blue arrow represents the latest 3 week numbers which I want to be preselected should always correspond to the system time. We are at present in week number 20 so the latest three weeknumber is Week17,Week18 and Week 20 so these three values should be preselected in the filter of the visualization.

 

Is it possible ? if so then how?

 

(I have used this DAX to calculate the weeknumber)

 

WeekNumber = WEEKNUM([Date]),21)

 

Expected output:

error_ticket.JPG

 

Input data :

 

DateLocation %attendance
01.12.2020   B170
01.12.2020   B120
01.12.2020   B161
02.12.2020   B230
01.05.2021   B329
01.05.2021   B380
03.05.2021   B322
04.05.2021   B420
18.05.2021   B561
19.05.2021   B130
20.05.2021   B229
21.05.2021   B380
22.05.2021   B454
23.05.2021   B438

 

Kind regards

Sameer

 

1 ACCEPTED SOLUTION
sanman
Helper I
Helper I

Create a new column called weekType and use dax to set that column to "Latest Week" if the date is from latest week. If not set it to "Prior Weeks".

 

Add Custom Column: WeekType = if Date.IsInPreviousWeek([Date]) then "Latest Week" else "Prior Weeks"

 

Then you can use the slicer with WeekType and Date heirerchy with the Latest Week checkbox selected.

 

Hope it works out!

View solution in original post

2 REPLIES 2
sanman
Helper I
Helper I

Create a new column called weekType and use dax to set that column to "Latest Week" if the date is from latest week. If not set it to "Prior Weeks".

 

Add Custom Column: WeekType = if Date.IsInPreviousWeek([Date]) then "Latest Week" else "Prior Weeks"

 

Then you can use the slicer with WeekType and Date heirerchy with the Latest Week checkbox selected.

 

Hope it works out!

Fowmy
Super User
Super User

@deb_power123 

This is not possible yet. if you want to filter any visual with relative date, you can use the filter pane to set it as follows

https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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