SUM

Emulación de la función TOTALYTD

The TOTALYTD function is easy to use and allows us to quickly calculate the result of an expression for the period between January 1st and the current context's last date, but sometimes we need more control over the evaluated expression. In this scenario, we will simulate the TOTALYTD function using other functions that would allow us this additional control.

We start with a table called Movements where we find financial movements associated with a date (we will assume that these are sales):

Submitted by admin on Mon, 01/09/2023 - 09:46

Calculation of accumulated totals

A common scenario is one in which we want to evaluate the accumulated total, including all data up to a certain date and not just those involved in the current filter context. For example, if we assume the existence of a sales table Sales that contains an Amount column with the sales figure, we could define a measure that calculates the sum of this column with the following DAX expression:

Submitted by admin on Sun, 01/08/2023 - 11:10