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! Learn more

Reply
jhaast
Helper II
Helper II

Yearweek slicer & Labels on slicer

Hello!

 

I have made a year+week slicer as shown below, those are combinations of the year and the weeknumber. 

However, the slicer has added all weeks between 201953 (year: 2019 and week 53) and 202000 (year: 2020 and week 00).

 

Screenshot001.jpg

 

10 REPLIES 10
geraldcousi
Frequent Visitor

I agree with JAAST, adn having the same need.

 

I want to avoid users to have to check every year+week within a "list" slicer, by using slicer as "betwwen". For instance : a user have to select values betwwen 2019-26 and 2019-43, it's not suitable to have to check every 18 values !

 

Is there an option to reduce the "between" slicer to the only existing values , or another slicer ?

 

Regards 

Anonymous
Not applicable

Hi @jhaast ,

Is there anything I can help you with? What do you want to do with the slicer? What requirement do you want to achieve? Here is a documentation describing the related information of slicer, hope it can help you.

 

Best Regards

Rena

I want to slice working hours of an employee, for example I want to see his/her working hours in a period of 2019 week 40 until 2020 week 10.

Anonymous
Not applicable

Hi @jhaast

If you want to calculate the working hours of each employee in a certain period of time, first you must  have the exact start time and end time, not some week. You can refer to the solutions in the following threads:

https://community.powerbi.com/t5/Desktop/Calculating-working-hours/m-p/461627

https://community.powerbi.com/t5/Desktop/Calculate-working-hours-within-a-date-range/m-p/652206

 

https://poszytek.eu/en/microsoft-en/office-365-en/powerbi-en/powerbi-datediff-only-working-days-hour...

Best Regards

Rena

hi @Anonymous,

 

I have a datasheet with the working hours of an employee for each day.

However, I only want to show the working hours of an employee in period of time between week xx of year xxxx and week xx of year xx.

But when I use multiple years, the yearslicer adds weeks with does not exist.

So I want to evaluate the performance of an employee between week 40 of 2019 and week 10 of 2020, but when I use a slicer then PBI will not stop at week 53 of 2019 but the slicer will also show the week 54, 55 and 56 .... of 2019 until week 00 of 2020 as 201954, 201955, ... 202000. Those weeks are unvalid weeks so I do not want those unvalid weeks in my slicer, which PBI has created.

 

Anonymous
Not applicable

Hi @jhaast ,

Because the field Yearweek is numeric type now, so when set the slicer type as "Between" , it will display all the value between start and end value.... You can try to set the slice type as "List":

Best Regards

Rena

 

Hi @Anonymous ,

 

Okay, so it is not possible to use a numerical slicer only for the existing numerical values?

Thank you for the list option, but that option is not usful to select multiple weeks of a long period.

 

Anonymous
Not applicable

Hi @jhaast,

Yes, but these invalid weeks displayed on slicer should not affect the calculation of working hours. It means that if you choose the week range of 51st week of 2019 to the 2nd week of 2020 , it should still calculate the 51st  , 52nd , 53rd week of 2019 and working hours for the 1st and 2nd week of 2020.

 

Best Regards

Rena

 

amitchandak
Super User
Super User

Your question is not clear to me, You change to a list, if required.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I have first created a datetable with the years and weeks combined as shown in picture 1.

However, when I create a slicer in the report view, then the slicer will create dates between 201953 and 202001, as shown in picture 2. Those are not valid weeks and will make a irrelevant part in the slicer.Screenshot.jpg

Picture 1.

Screenshot001.jpg

Picture 2.

 

Is there a solution for this problem?

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