Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi,
I have been struggling with this for a while, and have searched in vain!
I am looking for creating af running total of investments, where the start year has to be selected in a slicer, and then show running total from selected start year and 10 years forward.
My input table "Investment" table is like this:
Year | Dates | Investment |
2024 | 01-01-2024 | 500 |
2025 | 01-01-2025 | 500 |
... | ... | ... |
2040 | 01-01-2040 | 500 |
You seem to assume there's a starting year?
Yes, the starting year is to be selected in a slicer. Either connected or disconnected, both are possible!
Then the result will always be 5000.
Totally, the result will always be 5000. But each year, the sum is 500 + the sum of the previous year.
The challenge is to be able to select which year, the investments start, and how the cumulative value unfolds over the following 9 years.
So I guess we are back to this calculation!
Investment =
VAR SelectedYear = SELECTEDVALUE('dim year'[Year]) //disconnected slicer
VAR CumulativeValue =
CALCULATE(
SUM('Investment'[Investment]),
ALL('dim CALENDAR'[Dates]),
YEAR('dim CALENDAR'[Dates]) >= SelectedYear,
YEAR('dim CALENDAR'[Dates]) <= SelectedYear+9
)
RETURN CumulativeValue
Hi,
This solution unfortunately returns 5000 (the total investment sum of 10 * 500) on every year
What is your expected outcome?
The expected outcome is 500 the first year, and then the accumulated value with +500 each of the following years, so that in the 10th year, I reach 5000.
Hi Marianne,
maybe you have to remove the statement ALL('dim CALENDAR'[Dates]) from your measure.
Hi mangaus,
Thanks for your reply.
When I remove the ALL filter, it only shows investmenst on the selected year!
you seem to be missing the "plus ten years" filter?
Thanks for your reply.
I have tried this, to include the 10 years, but that did not work:
Investering sim fra første inv-år mio. kr. (EOS) =
VAR SelectedYear = SELECTEDVALUE('dim year'[Year])
VAR YearsToCalculate = ADDCOLUMNS(
GENERATESERIES(SelectedYear,SelectedYear + 9),
"CumulativeYear",
[Value],
"CumulativeValue",
CALCULATE(
SUM('Investment'[Investment]),
FILTER(
ALL('dim year'[Year]),
'dim year'[Year] >= SelectedYear &&
'dim year'[Year]<= MIN([Value])
)
)
)
RETURN
SUMX(YearsToCalculate, [CumulativeValue])
Any suggestions?
Thanks,
Marianne
Try something less complicated. Keep your ALL filter but add a filter for the year range. No need for generateseries, addcolums etc.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
85 | |
83 | |
66 | |
60 | |
56 |
User | Count |
---|---|
183 | |
111 | |
105 | |
77 | |
70 |