Forum Discussion
frostys
Helper I
8 years agoTime Slicer
Hi ! I put a time slicer in a report : The data come directly from a "date" column. I try to make an automatic selection for the current year and current month selected. (Exempl...
Anonymous
8 years agoNot applicable
So the way I would do this is through changing the measure you are using for the visuals.
something like this should work, when a single month is selected it will calculate the specificd measure from the start of the calendar year to the previous month.
Measure =
IF (
HASONEVALUE ( DateTable[Month] ),
CALCULATE (
[Measure],
DATESBETWEEN (
DateTable[Date],
DATE ( YEAR ( MAX ( DateTable[Date] ) ), 1, 1 ),
EOMONTH ( MAX ( DateTable[Date] ), -1 )
)
)
)
frostys
Helper I
8 years agoI change some syntax who were not working, so this is the syntax who work
date2 =
IF (
HASONEVALUE ( 'Data input'[Date].[Month] );
CALCULATE (
DATESBETWEEN (
'Data input'[Date].[Date];
DATE ( YEAR ( MAX ( 'Data input'[Date].[Date] ) ); 1; 1 );
EOMONTH ( MAX ( 'Data input'[Date].[Date] ); -1 )
)
)
)
Otherwise, is is not accept this measure as slicer