Forum Discussion
ValeriaBreve
4 years agoPost Partisan
Use What-If parameter for selecting a date interval
Hi, I wanted to use the what-if parameters for users to be able to select: 1) Number of days before production date 2) Number of Days after production date So as to give them a relative date i...
- 4 years ago
A calculated column won't work as it is only calculated during data refresh, it does not take into account any filters or slicers so won't update when your user changes the what if parameter.
You could create a calculation group with a single calculation item, something like
Filtered days calculation = VAR numDays = SELECTEDVALUE ( 'What if parameter'[Num days] ) VAR baseDate = TODAY () VAR startDate = baseDate - numDays VAR endDate = baseDate + numDays RETURN CALCULATE ( SELECTEDMEASURE (), DATESBETWEEN ( 'Date'[Date], startDate, endDate ) )then apply that as a filter to the visuals which you want to be filtered
johnt75
4 years agoSuper User
You'd need to use a service like We Transfer, or share a link directly from Google Drive or OneDrive. You can either post the link here or send me a private message
ValeriaBreve
4 years agoPost Partisan
great - that works. I will post again as soon as I can compile a pbix without confidential info. Thanks!