Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
I have a custom date range. what I want is If someone select last 30 days, Last Month, This month so i have calculated the start date and enddate Accordingly based on users selection that will be applied to entire page and the custom date slicer as well
Could you please try below Steps:
1. Create Helper table (for the slicer):
DateRange = DATATABLE("Option", STRING,
{{"Last 30 Days"},{"Last Month"},{"This Month"}})
2. Two measures:
StartDate =
SWITCH( SELECTEDVALUE(DateRange[Option]),
"Last 30 Days", TODAY() - 30,
"Last Month", EOMONTH(TODAY(),-2) + 1,
"This Month", EOMONTH(TODAY(),-1) + 1)EndDate =
SWITCH( SELECTEDVALUE(DateRange[Option]),
"Last 30 Days", TODAY(),
"Last Month", EOMONTH(TODAY(),-1),
"This Month", TODAY())
3. One filter measure:
InRange =
VAR s = [StartDate]
VAR e = [EndDate]
RETURN IF( MAX('Date'[Date]) >= s && MAX('Date'[Date]) <= e, 1, 0 )
4. Put DateRange[Option] as a slicer >> add InRange = 1 in the page/visual filter pane.
Now picking an option updates the entire page (and any custom date slicer that’s bound to your Date table).
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 52 | |
| 42 | |
| 18 | |
| 14 |
| User | Count |
|---|---|
| 111 | |
| 104 | |
| 35 | |
| 27 | |
| 27 |