Forum Discussion
ragnezza
3 years agoFrequent Visitor
Date Range based on Slicer selection
Hello - I'm looking to return a list of the previous "X" days based on a selected day from a slicer. For example, once a day is selected in the 'Date' slicer, I want to return the date range in t...
- 3 years ago
Thanks DataNinja777 . This can work if I want to have the cumulative "Daily Trends" up to the selected day.
For this purpose I find this other solution:
Measure =
if( MAX( 'Main_Table'[Date]) >= SELECTEDVALUE('Date'[Date],min('Date'[Date]) )-180 &&
MAX( 'Main_Table'[Date]) <= SELECTEDVALUE('Date'[Date],max('Date'[Date]) ),
"Yes", "No" )And then use this 'Measure' as a filter in the visualization.
DataNinja777
Super User
3 years agoHi @ragnezza,
What about using DATESINPERIOD function?
DATESINPERIOD function (DAX) - DAX | Microsoft Learn
Something like below is how it can be used: