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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Filter weeks at a time

How would I go about setting up a table to create a weekly filter?

I have my main table with a date/time column.

The user wants to be able to have a slicer that filters visualizations for one week at a time. 

I've created a separate table with the following columns:

dpibarker_0-1681393726884.png

The week starts on Monday, not Sunday. 

So the user wants a slicer to filter data from Monday - Sunday. The slicer would have dates like 

1/2/2023

1/9/2023

1/16/2023

....

but when a date is chosen, the table/visualizations display data from 1/2/2023 - 1/8/2023, 1/9/2023 - 1/15/2023, 1/16/2023 - 1/22/2023.....

1 REPLY 1
v-xinruzhu-msft
Community Support
Community Support

Hi @Anonymous 

You can refer to the following sample

Sample data 

vxinruzhumsft_0-1681699286629.png

 

Another data table

vxinruzhumsft_1-1681699299760.png

 

Based on the slicer you have offered, it display the date of Sunday, so  create a measure

Measure = IF(ISFILTERED('Table (3)'[Date]),IF(SELECTEDVALUE('Table 2'[Date])-WEEKDAY(SELECTEDVALUE('Table 2'[Date]),2)+1=SELECTEDVALUE('Table (3)'[Date])+1,1,0),1)

Then put the measure to the table visual filter

vxinruzhumsft_2-1681699532709.png

 

Output

vxinruzhumsft_3-1681699545725.png

 

Best Regards!

Yolo Zhu

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

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.