Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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])
Hi @tamerj1
The dax for that measure is
Afkast - Month afkast =
IF(
MONTH(SELECTEDVALUE('DimDate'[Date]))=1,
SUM('FactAfkast'[Afkast eksl. FX]),
SUM(FactAfkast[Afkast eksl. FX])-[Afkast - Previous month afkast])
Let me know if you have any additional questions.
Best Regards,
Solle
And for the measure "Afkast - Previous Month Afkast" it is
Afkast - Previous month afkast =
CALCULATE(SUM('FactAfkast'[Afkast eksl. FX]),PREVIOUSMONTH('DimDate'[Date]))
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
11 | |
9 | |
6 |