cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MH3
Helper IV
Helper IV

Last Week Number Selected in Slicer

Hi,

 

I have a WeekNumber Column in my Calender Table for the year 2020 and 2021,

WeekSelected.jpg

Now, if the user selects the year 2021, from the slicer on the Home page and then navigates to the Weekly page it should show the last week data and the week number should be pre selected in the Week Slicer, and the user can also change the week accordingly otherwise it should show the last week data as week number is selected in Slicer.

I have created a Week Type Column, which shows "Last Week" Dates and "This Week" Dates

weektype.jpg
But, I am unable to set the Last Week, Week Number as pre selected in Week Slicer.

@amitchandak 
Any Help ??

1 ACCEPTED SOLUTION
tex628
Super User II
Super User II

I believe i do! 🙂 

What i mean is that you need to create a new column to use in the slicer and make sure that this column is sorted in a way where the "Last week" value always will be located at the top. 

Like this:

tex628_0-1617103391916.png


Br,
J


Connect on LinkedIn

View solution in original post

6 REPLIES 6
tex628
Super User II
Super User II

Hi @MH3

I'd say you need to make sure that the value for last week is always the first instance in that filter. Currently it appears that the first value is "Week - 1 - 2021" as you have an ascending sorting order in the slicer. 

If you change that to decending you will instead either get the current week, or some week in the future depending on how the filtering looks. 

My recommendation is to create a calculated column where you make sure that the "Last week" value is going to be the first one when you sort either acending or decending. 

Hope this helps, 

Br, 
J


Connect on LinkedIn

@tex628  Thanks for your reply.

 

But, actually the Week Number column has only Week Number for the whole year from 1 to 52 /53 
and the column Weektype has Values of Week, Last Week and This Week as you can see in the Table ScreenShot.
I acutally want that slicer to be pre selected of that last week, week number i.e Week -12- 2021 for the month of March which is  22 to 28 March. 

hope you understand

tex628
Super User II
Super User II

I believe i do! 🙂 

What i mean is that you need to create a new column to use in the slicer and make sure that this column is sorted in a way where the "Last week" value always will be located at the top. 

Like this:

tex628_0-1617103391916.png


Br,
J


Connect on LinkedIn

View solution in original post

@tex628 
Well as per your workaround, I have done this

WeekNumberTest = if(DimDate[Week Type]="Last Week", "0 - Last Week",DimDate[WeekNumber])


and I dropped that field into the Slicer
weeek.jpg

The Date Range on the Top Right shows the correct Date Range from 22 to 28 March. 😄
Will this work as a professional workaround? or it's just a used case scenario?

tex628
Super User II
Super User II

Well it's the default functionality of the single select slicer to use the first indexed value in the slicer column. You will meet issues if you allow users to save filter applications in service, as this will override the default functionality so you will either need to remove that possibilty or live with the fact that user filter selections will affect the state of the report.

Br, 
Johannes


Connect on LinkedIn

@tex628  Yes, I am agreed to that fact, if the user changes the slicer value it will be saved with that selection.
But, is there any kind of workaround, if the user navigates back to that weekly report, the slicer should reset to the default value, i.e the first value?

Any idea

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Top Solution Authors
Top Kudoed Authors