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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Millar
Frequent Visitor

Powerbivisual

Need to create a date filter by using slicer which contain start date and end date
when ever report gets loaded its should show default values form
start date should be :01-Feb-2023
end date should be: Today's day ( dynamically)

also when ever user want to change the same start data and end date those option also need to enable in slicer.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Millar ,

 

I created some data:

vyangliumsft_0-1704781209578.png

 

Here are the steps you can follow:

1. Create calculated table.

Table 2 =
DISTINCT('Table'[Date])

vyangliumsft_1-1704781209579.png

2. Create measure.

Flag =
var _mindate=
MINX(ALLSELECTED('Table 2'),'Table 2'[Date])
var _maxdate=
MAXX(ALLSELECTED('Table 2'),'Table 2'[Date])
return
IF(
    ISFILTERED('Table 2'[Date])=FALSE()&&MAX('Table'[Date]) >=DATE(2023,2,1)&&MAX('Table'[Date])<=TODAY(),1,
    IF(
    ISFILTERED('Table 2'[Date])=TRUE()&&MAX('Table'[Date]) >=_mindate&&MAX('Table'[Date])<=_maxdate,1,0))

3. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_2-1704781257135.png

4. Result:

Slicer has no selected value

vyangliumsft_3-1704781268868.png

Slicer selected value

vyangliumsft_4-1704781268870.png

 

Best Regards,

Liu Yang

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

2 REPLIES 2
Anonymous
Not applicable

Hi  @Millar ,

 

I created some data:

vyangliumsft_0-1704781209578.png

 

Here are the steps you can follow:

1. Create calculated table.

Table 2 =
DISTINCT('Table'[Date])

vyangliumsft_1-1704781209579.png

2. Create measure.

Flag =
var _mindate=
MINX(ALLSELECTED('Table 2'),'Table 2'[Date])
var _maxdate=
MAXX(ALLSELECTED('Table 2'),'Table 2'[Date])
return
IF(
    ISFILTERED('Table 2'[Date])=FALSE()&&MAX('Table'[Date]) >=DATE(2023,2,1)&&MAX('Table'[Date])<=TODAY(),1,
    IF(
    ISFILTERED('Table 2'[Date])=TRUE()&&MAX('Table'[Date]) >=_mindate&&MAX('Table'[Date])<=_maxdate,1,0))

3. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_2-1704781257135.png

4. Result:

Slicer has no selected value

vyangliumsft_3-1704781268868.png

Slicer selected value

vyangliumsft_4-1704781268870.png

 

Best Regards,

Liu Yang

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

 

New column created under table level

Period = if('DMADP OPEM_ADP_DATE_D'[Date]>EOMONTH(TODAY(),-12)&&'DMADP OPEM_ADP_DATE_D'[Date]<=TODAY(),1,0)

 

And placed under page filter level set values as 1

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.