Forum Discussion
Joshua_
Helper II
5 years agoHelp with the date filter
Hi Guys, I need to calculate the sales per month between 2 dates, I created in the calendar table two columns with the maximum date and the minimum date, I also created a measure with the datebe...
- 5 years ago
Does it do what you expect if you use KEEPFILTERS to prevent DATESBETWEEN from overriding the month?
Saldo = VAR INI = SELECTEDVALUE ( CALENDARIO[INICIO_HISTORICO] ) VAR FIN = SELECTEDVALUE ( CALENDARIO[FIN_HISTORICO] ) RETURN CALCULATE ( [Saldo_Prom], KEEPFILTERS ( DATESBETWEEN ( CALENDARIO[Date], INI, FIN ) ) )
AlexisOlson
Super User
5 years agoDoes it do what you expect if you use KEEPFILTERS to prevent DATESBETWEEN from overriding the month?
Saldo =
VAR INI = SELECTEDVALUE ( CALENDARIO[INICIO_HISTORICO] )
VAR FIN = SELECTEDVALUE ( CALENDARIO[FIN_HISTORICO] )
RETURN
CALCULATE (
[Saldo_Prom],
KEEPFILTERS ( DATESBETWEEN ( CALENDARIO[Date], INI, FIN ) )
)Joshua_
Helper II
5 years agoIt was just what I needed, thank you very much AlexisOlson