Forum Discussion
Solle
Helper III
3 years agoSummarize between selected dates from slicer
Hi All,
I have a measure named "Afkast - Month Afkast" which generates each month return. Then I have a slicer which is using "between" as the style. What I want to accomplish is to generate the sum of monthly returns between two dates selected from the slicer.
I have tried the below code, but this just gives me from the start of the dates till the selected max value in the data slicer. So it is ignoring the start date in the slicer.
Afkast - Period Afkast =
VAR v2 =
SUMMARIZE(
FILTER(
'DimDate',
'DimDate'[Date]>=MIN(DimDate[Date]) && 'DimDate'[Date]<= MAX('DimDate'[Date])
),
'DimDate'[Date],"Sum",[Afkast - Month afkast])
RETURN
SUMX(v2,[sum])Does anyone know how to accomplish this? Unfortunately I have to have month returns as a measure due to the data structure.
Best Regards,
Solle
3 Replies
- Solle
Helper III
And for the measure "Afkast - Previous Month Afkast" it is
Afkast - Previous month afkast = CALCULATE(SUM('FactAfkast'[Afkast eksl. FX]),PREVIOUSMONTH('DimDate'[Date]))