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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Naveen29
Helper II
Helper II

DAX

I have a requriment creating slicers as like below.

when users selects the slicer 1 , accordinly the slicer2 values should display.

 

Period (slicer1)Slicer2Data should be
WeeklyWeek start date - End date along with Year/MonthEx:  2022/Augu8th- August12th
MonthlyYear\Month2022 | August
YearlyYear\Month2022

 

Naveen29_0-1664223948882.png

 

1 REPLY 1
Anonymous
Not applicable

Hi @Naveen29 ,

You can refer the following links to get it:

Custom Range Date Slicer in Power BI with dynamic defaults and more...

SpecialDates = 
VAR _datetable = CALENDAR (DATE(2022,1,1), DATE(2022,12,31))
VAR _today = TODAY()
VAR _month = MONTH(TODAY())
VAR _year = YEAR(TODAY())
VAR _thismonthstart = DATE(_year,_month,1)
VAR _thisyearstart = DATE(_year,1,1)
VAR _lastmonthstart = EDATE(_thismonthstart,-1)
VAR _lastmonthend = _thismonthstart-1  
VAR _thisquarterstart = DATE(YEAR(_today),SWITCH(true,_month>9,10,_month>6,7,_month>3,4,1),1)
RETURN UNION(
    ADDCOLUMNS(FILTER(_datetable,[Date]=_today),"Period","Today","Order",1),
    ADDCOLUMNS(FILTER(_datetable,[Date]=_today-1),"Period","Yesterday","Order",2),
    ADDCOLUMNS(FILTER(_datetable,[Date]>_today-7),"Period","Last 7 Days","Order",3),
    ADDCOLUMNS(FILTER(_datetable,[Date]>=_thismonthstart),"Period","This Month","Order",4),
    ADDCOLUMNS(FILTER(_datetable,[Date]>=_thisquarterstart),"Period","This Quarter","Order",5),
    ADDCOLUMNS(FILTER(_datetable,[Date]>=_thisyearstart),"Period","This Year","Order",6),
    ADDCOLUMNS(FILTER(_datetable,[Date]>_today-30),"Period","Last 30 Days","Order",7),
    ADDCOLUMNS(_datetable,"Period","Custom...","Order",8)
    )

yingyinr_0-1664258355145.png

Custom Date Period Selections in Power BIyingyinr_1-1664258457826.png

Create a time period table DAX

If the above one is not what you want, please provide more details on the function or logic of "cascading" slicers. Thank you.

Best Regards

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.