The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance 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 |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
34 | |
15 | |
12 | |
7 | |
6 |