Forum Discussion
Create a compound Filter for a prompt date
- Anonymous1 year ago
Hi STIBBS_807
Here's a idea for your reference:
You can create a calendar table for your date selection:
DateSelection = CALENDAR(MIN('YourTable'[StartDate]), MAX('YourTable'[EndDate]))Then add a measure for the selected date:
SelectedDate = SELECTEDVALUE(DateSelection[Date])Finally, create a measure to filter the data based on the criteria you provided:
FilteredData = CALCULATE( [YourMeasure], FILTER( YourTable, YourTable[StartDate] <= [SelectedDate] && ( ISBLANK(YourTable[EndDate]) || YourTable[EndDate] >= [SelectedDate] ) ) )At last, you can add a slicer to your report for the DateSelection table, so the user can pick a specific date, and use the measure in the visual.
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi STIBBS_807
Here's a idea for your reference:
You can create a calendar table for your date selection:
DateSelection = CALENDAR(MIN('YourTable'[StartDate]), MAX('YourTable'[EndDate]))
Then add a measure for the selected date:
SelectedDate = SELECTEDVALUE(DateSelection[Date])
Finally, create a measure to filter the data based on the criteria you provided:
FilteredData =
CALCULATE(
[YourMeasure],
FILTER(
YourTable,
YourTable[StartDate] <= [SelectedDate] &&
(
ISBLANK(YourTable[EndDate]) ||
YourTable[EndDate] >= [SelectedDate]
)
)
)
At last, you can add a slicer to your report for the DateSelection table, so the user can pick a specific date, and use the measure in the visual.
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- HamedM11251 year agoAdvocate III
Anonymous One thing I would like to add is when the value of a date is blank the slicer (with a slider) will skip it, unless the blank value is replaced with a future date in the Power Query.