How to Calculate Cumulative SUM or Running Total in Microsoft POWER BI - DAX

preview_player
Показать описание
How to Calculate Cumulative SUM or Running Total in Microsoft POWER BI - DAX
Рекомендации по теме
Комментарии
Автор

EXPLANATION:
Cumulative_SUM = : This part just gives the calculation a name.

CALCULATE( SUM(Data[Sales]) ) : This part finds the total sales for the entire period.

FILTER( ALLSELECTED(Data[Months]), ) : This part looks at each month and adds up all the sales from the beginning of the year up to that month.

VALUES(Data[Year]) : This part makes sure the calculation is done for each year separately.

In simpler words: The formula takes your sales data, adds up the sales month by month for each year, and gives you a running total of sales.

ExcelBasement
Автор

Cumulative_SUM =
CALCULATE(
SUM(Data[Sales]),
FILTER(
ALLSELECTED(Data[Months]),
Data[Months]<=MAX(Data[Months])),
VALUES(Data[Year])
)

ExcelBasement