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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Date slicer - Multi dates

Hello All,

 

I'm trying to create a date filter with following scenario:

 

1. IF Monday - Display Fri date

2. IF Tuesday - display Sat , Sun, Mon dates

2. Rest all Day - 1

 

I want to display like below : 

 

Slicer Date     Date      

10/12/2021   10/11/2021     

                      10/10/2021    

                      10/09/2021   

10/11/2021   10/08/2021

10/10/2021  10/09/2021     

10/09/2021   10/08/2021     

 

Tried below option:

 

DATE = IF ( 'DateDim' [DayofWeek] = "Monday", 'DateDim'[Date] - 3,

             IF ( 'DateDim' [DayofWeek] = "Tuesday",

                 VAR Current_date = LASTDATE('DateDim'[Date])

                     VAR NumberofDays = WEEKDAY(LASTDATE('DateDim'[Date]) ,1)

                          RETURN   DATEADD(Current_date, -1 * NumberofDays, DAY), 

            'DateDim'[Date] -1 ) )

                  

 Result : for 10/12/2021 it shows 10/09/2021 date only. I want to see 10/09 , 10/10, 10/11

 

powerbi_ki_1-1634580568568.png

 

 

TIA

1 ACCEPTED SOLUTION
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous 

 

Based on test, we haven’t found a method to put Date column and Slicer Date column to same table visual. But you may consider this solution.

1 Create a Slicer with Date column from Slicer table

vcazhengmsft_0-1635236797301.png

 

2 Create a Measure to set flag for Date column from Date table

Flag =

var _selecteddate=SELECTEDVALUE('Slicer'[Date])

var _weeknum=WEEKNUM(_selecteddate)

var _weekday=WEEKDAY(_selecteddate,2)

return

SWITCH(

    _weekday,

    1,IF(MAX('calender'[Date])=_selecteddate-3,1,0),

    2,IF((MAX('calender'[Date])>=_selecteddate-3&&MAX('calender'[Date])<=_selecteddate-1),1,0),

    IF(MAX('calender'[Date])=_selecteddate-1,1,0))

 

3 Use Date column to create Table visual and use Flag measure to set filter on this visual

vcazhengmsft_1-1635236797304.png

 

4 Select a date in Slicer, you will get expected date in Table visual

vcazhengmsft_2-1635236797306.png

 

For more details, you can refer to the uploaded pbix file.

 

Best Regards,
Community Support Team _ Caiyun


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If you still have questions, please feel free to let me know. Thanks in advance!

View solution in original post

3 REPLIES 3
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous 

 

Based on test, we haven’t found a method to put Date column and Slicer Date column to same table visual. But you may consider this solution.

1 Create a Slicer with Date column from Slicer table

vcazhengmsft_0-1635236797301.png

 

2 Create a Measure to set flag for Date column from Date table

Flag =

var _selecteddate=SELECTEDVALUE('Slicer'[Date])

var _weeknum=WEEKNUM(_selecteddate)

var _weekday=WEEKDAY(_selecteddate,2)

return

SWITCH(

    _weekday,

    1,IF(MAX('calender'[Date])=_selecteddate-3,1,0),

    2,IF((MAX('calender'[Date])>=_selecteddate-3&&MAX('calender'[Date])<=_selecteddate-1),1,0),

    IF(MAX('calender'[Date])=_selecteddate-1,1,0))

 

3 Use Date column to create Table visual and use Flag measure to set filter on this visual

vcazhengmsft_1-1635236797304.png

 

4 Select a date in Slicer, you will get expected date in Table visual

vcazhengmsft_2-1635236797306.png

 

For more details, you can refer to the uploaded pbix file.

 

Best Regards,
Community Support Team _ Caiyun


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If you still have questions, please feel free to let me know. Thanks in advance!

Anonymous
Not applicable

Thanks Caiyun, this alternate solution worked.

Anonymous
Not applicable

Bumping up to get visibility. Thanks.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.