Forum Discussion
filtered dCalendar
Can't you use the regular date slicer set to "Between"?
You will need a Calendar Table for that though
Hi, Paul, the intention is for the user to choose only one date.
- PaulDBrown5 years ago
Community Champion
...and the measure calculates what date range?
- STEPH00185 years ago
Helper II
SELECTEDVALUE(dCalendario[DATA]) andLASTDATE(PARALLELPERIOD(dCalendario[DATA],-1, YEAR))- PaulDBrown5 years ago
Community Champion
Do you want to see the data for the last year based on the date selected?
See if this works for you.
1) Duplicate you date table using (I've called the duplicate "Period Filter") new table in the ribbon and
Period Filter = 'Calendar Table'Join this table to the Calendar table in a1-to many inactive relationship with a single filter direction from the Period Filter Table to the Calendar Table. The model should look like this:
Now add the slicer from the calendar table, and create the visual using the date field from the Period filter table as the axis.
Create a measure along these lines:
Data by sel date = VAR CalD = MAX('Calendar Table'[Date]) VAR SelPeriods = DATESINPERIOD('Period Filter'[Date], CalD, -1, YEAR) RETURN CALCULATE([Sum of Sales], REMOVEFILTERS('Calendar Table'), KEEPFILTERS(SelPeriods), USERELATIONSHIP('Calendar Table'[Date], 'Period Filter'[Date]))Add this measure to the visual and you will get: