Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Dear Community,
I want to display the total of a column cummulative for each year. For example to calculate the value of 2023 and 2024 in the screenshot below:
I use the following DAX, which give me the correct result.
However, when I show all of the investments transactions (around 15.000 rows) the report page is a bit slow when I filter or browse the matrix. Any suggestions to get the same result but faster meaning by doing less computations?
Thank you all in advance
Solved! Go to Solution.
@pmmarinou This will be a measure, here is a generic pattern:
VAR DailyAmount =
ADDCOLUMNS (
ALL ( DateTable[Date] ),
"@Amount", [Amount]
)
VAR LastVisibleDate =
MAX ( DateTable[Date] )
VAR PreviousDates =
FILTER (
DailyAmount,
DateTable[Date] <= LastVisibleDate
)
VAR RunningTotal =
SUMX ( PreviousDates, [@Amount] )
RETURN
Result
See if this works?
@pmmarinou This part
YEAR(MAX(DateTable[Date])) = MAX(DateTable[Year])
of your code is always going to evaluate to TRUE because both are fetching the Date and Year of the same year from the filter context, are you assuming it is referencing to row context created by FILTER?
To make it faster you can first pre compute the Amount with the help of
ADDCOLUMNS ( ALL ( DateTable[Date] ), "Amount", [Amount] )
construct and then FILTER it accordingly, use variables to segregate the code into chunks.
YEAR(MAX(DateTable[Date])) = MAX(DateTable[Year])
of your code is always going to evaluate to TRUE because both are fetching the Date and Year of the same year from the filter context, are you assuming it is referencing to row context created by FILTER?
Ok I edited it like this and it seems to work:
To make it faster you can first pre compute the Amount with the help of
ADDCOLUMNS ( ALL ( DateTable[Date] ), "Amount", [Amount] )
construct and then FILTER it accordingly, use variables to segregate the code into chunks.
The DataTable and the Transaction Table are different. Can I return a new table from two tables using this function?
Thank you for your reply and help!
@pmmarinou This will be a measure, here is a generic pattern:
VAR DailyAmount =
ADDCOLUMNS (
ALL ( DateTable[Date] ),
"@Amount", [Amount]
)
VAR LastVisibleDate =
MAX ( DateTable[Date] )
VAR PreviousDates =
FILTER (
DailyAmount,
DateTable[Date] <= LastVisibleDate
)
VAR RunningTotal =
SUMX ( PreviousDates, [@Amount] )
RETURN
Result
See if this works?
Using
ADDCOLUMNS ( ALL ( DateTable[Date] ), "@Amount", [Amount] )
I lose all the other columns included in my transaction table needed for filtering
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
15 | |
11 | |
10 | |
10 |