Forum Discussion
Navigating employee leave data within a year
Hello,
I want to make a report based on the employee leave days like below:
The top bar with numbers is the week number within a year, so when I click week 1 it will display 01/01/2024 – 07/01/2024, week 2 will display the 08/01/2024 – 14/01/2024, and so on.
My senior asked if I could make a better layout and make navigating the weeks within the year simpler. So, they asked if I could add some arrows next to the week number (as shown on the picture) and said that it takes a lot of effort to scroll through the slicer for the week. But I just couldn't find the way to make the arrows do just that. For example, if today is week 34, if I click the arrow to the right, it will display the data for week 35 (26/08/2024 – 01/09/2024). And if I click the arrow to the right again, it will display the data for week 36 (02/09/2024 – 08/08/2024). The same goes if I click the arrow to the left.
Additionally, they also asked if I could make it always display for the current week whenever the file is opened. For example, if we enter week 35, the slicer automatically selects the week 35 and displays the data for the corresponding week. Right now, I must manually select it every time the week changes. I tried watching this video: https://www.youtube.com/watch?v=VaJ10ilXp6Y but unfortunately that does not solve my problem since you cannot select the week before today.
Lastly, it gives another problem. Since 30 and 31 December 2024 falls in the 1st week of 2025, powerBI displays it as week 53, as seen in the picture:
My senior said it should be included in week 1 of 2025, but when I change the week number to 1, it shows on my week 1 2024 (the data will display 01/01/2024 – 07/01/2024 and 30/12/2024 - 31/12/2024). That does not leave me satisfied as the week 1 now has additional dates instead.
I am a newbie when it comes to PowerBI, so please be kind. I have been using ChatGPT to help me building the report and so far, it has been going well until it is not.
Thank you for your help!
4 Replies
- AnonymousNot applicable
Hi Anonymous
Maybe you can try this alternative workaround:
Here I create a set of sample:
The WeekNum column is built by:
WeekNum = WEEKNUM('Table'[Date])Then add a new table:
Table 2 = VALUES('Table'[WeekNum])Next, add a measure:
Sum = VAR _currentWeek = MAX ( 'Table 2'[WeekNum] ) RETURN IF ( MAX ( 'Table'[WeekNum] ) = _currentWeek, SUM ( 'Table'[Column] ) )Finally, add a Slicer with the field 'Table2'[WeekNum]:
The result is as follow:
About how to select currentweek, this blog could help:
How to dynamically select the default values we ne... - Microsoft Fabric Community
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- AnonymousNot applicable
Hi Anonymous ,
Thank you for your assistance.
Unfortunately, they are not satisfied with this workaround and insists that it is possible to use the arrows to navigate the weeks. However, I thank you for the select currentweek blog as it is very helpful.
Regards,- AnonymousNot applicable
Hi Anonymous
Have you solved your problem? If so, can you share your solution here and mark the correct answer as a standard answer to help other members find it faster?
Thank you very much for your kind cooperation.
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.