1
votes

I have a power BI report that need A default start date of two weeks ago and end date of Today. However, I also want the user to select other date ranges from the slicer if they want. Is there a way I can achieve it with power BI slicer? enter image description here

If yes How can I do it?

1
Why are there people here letting others think over their problems without being interested in the results? Is that some form of anti-social behavior?Peter

1 Answers

2
votes

You need a second slicer to switch between your default date period (separate date table) and a custom date period.

Date Periods = 
UNION(
    ADDCOLUMNS(
        DATESBETWEEN('Calendar'[Date], TODAY() - 13, TODAY()),
        "Type", "Default"
    ADDCOLUMNS(
        CALENDAR(MIN('Calendar'[Date]),MAX('Calendar'[Date])),
        "Type", "Custom"
    )
)

Plus you need a measure to filter your first slicer depending on the selection.

Slicer Filter = 
IF(
    SELECTEDVALUE('Date Periods'[Type]) = "Custom",
    1,
    0
)