Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
hemingt
Helper V
Helper V

how to filter slicer date

Hi Team,

 

I have a Slicer with all the Week number of total year.

I want to only show the Week number to current Week number, 

take an example, current week is 1914, I only show the Week number from 1901~1914 in the Slicer.

The displayed week number can be updated with the time going. We can see 1901~1915 in the Slicer next week.

Is it possible?  Thank you!

 

360279516437.jpg

1 ACCEPTED SOLUTION

HI, @hemingt 

 measure could not be dragged into the threshold.

For your requirement, you could try this way:

I defined a new measure Current_Week=WEEKNUM(TODAY(),2)

Add a column

New Column =IF( Closed_Week <= WEEKNUM(TODAY(),2) ,1 ,0 )

Then drag this new column into Page level filter and set is 1.

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
Nishantjain
Continued Contributor
Continued Contributor

One possible way would be to use relative date filter in the filter pane

Drop the page field in the page level filter and then use relative filter to filter days as of today. This should automatically filter the weeks relative to today's date

Hi @Nishantjain 

 

That's a good idea.

I defined a new measure Current_Week=WEEKNUM(TODAY(),2)

I want to filter [Week] <= Current_Week

But I have a try, it seems that I could not drag the measure to the page filter value.

Nishantjain
Continued Contributor
Continued Contributor

You cant drop a measure in page level filter. It has to be a field

I would recommend you create a calculated column in your week table that gives you the last day (or first day) of the week. Use this date field in page level filter along with relative filter

Hi @Nishantjain 

 

As the below picture show, I created a measure named as Current_Week, I want to use it as the threshold to filter the Closed_Week, let Closed_Week <= Current_Week.

It seems Power BI did not support the measure as the threshold?

 

36-366783718.jpg

This issue has been solved by using Sync Slicers group. Thank you for your view.

HI, @hemingt 

 measure could not be dragged into the threshold.

For your requirement, you could try this way:

I defined a new measure Current_Week=WEEKNUM(TODAY(),2)

Add a column

New Column =IF( Closed_Week <= WEEKNUM(TODAY(),2) ,1 ,0 )

Then drag this new column into Page level filter and set is 1.

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I'm sorry for my above reply for wrong post thread.

Thank you @v-lili6-msft , you're always so helpful!

v-lili6-msft
Community Support
Community Support

hi, @hemingt 

Now when you log out of Power BI and come back to a report, the same items will be selected as when you left.

So for your requirement, it couldn't achieve that set a default value(or maxdate) for a slicer.

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/7162004-default-selected-slicer-o...

and as a workaround, you add a column to judge if the week is before current Week number then set it in visual/page/report level filter or create a measure do the same work. eg. https://community.powerbi.com/t5/Service/How-to-set-a-time-slicer-to-select-the-latest-date-in-defau...

 

Best Regards,
Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hemingt
Helper V
Helper V

Is there any suggestion? Thank you!

Team,

Please help to have a look, is there any soulution? Thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.