Forum Discussion
Relative Date Slicer
I'm working with the Relative Date Slicer in Power BI and I'm interested in capturing the specific selections made by a user.
I need to extract the following details from the slicer's settings:
- Temporal Context: I want to identify whether the user has chosen the current period ('this'), the previous period ('last'), or the upcoming period ('next').
- Amount Input: I'm looking to retrieve the numerical value input by the user, such as '1', '2', or '3', which indicates the quantity of the selected period.
- Period Selection: I need to discern the type of period the user has selected, such as 'day', 'week', or 'month'.
My goal is to understand the user’s choice in the Relative Date Slicer in order to further customize the data presentation or perform additional calculations based on these selections. Any guidance on how to programmatically access these slicer inputs would be greatly appreciated.
2 Replies
- amitchandakSuper User
richar , I doubt you can programmatically access .
But Values(date[Date]) will give you all the dates that selected using slcier. Date[Date] is column use in relative date slicer
or
minx(allselected(Date), Date[Date])
Maxx(allselected(Date), Date[Date])
to get the min and max dates of the slicer
- sebastiaanwRegular Visitor
But I think the goal here is to read the user input so that it can be used to compare data against a similar period. So let's say it's the 1st of May, and the user is looking at data from the 1st of April to the 30th of April. We then want to compare this period to a previous period based on the user's selection. However, based on the dates alone, we would not know what to compare it against. Did the user select the last 30 days? Or did they select the last 1 calendar month? Based on the dates, it could be either. So solely based on the dates, we don't know what to compare it against.