Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
gusfablop
New Member

I need to create the calculated column with DAX

CalculateColumnPowerBI.jpg

 

I need to create the calculated column "CumulativeCOL A", where I accumulate the sum of the values in column A, the previous value and the current value, with the formula I show in column E.
That is:
for the cell D2= A2
for the cell D3= +D2+A3
for the cell D4= +D3+A4
for the cell D5= +D4+A5
for the cell D6= +D5+A6
for the cell D7= +D6+A7
for the cell D8= +D7+A8
for the cell D9= +D8+A9
for the cell D10= +D9+A10
for the cell D11= +D10+A11

 

In Spanish

Necesito crear la columna calculada "CumulativeCOL A", donde acumule la sumatoria de los valores de la columna A, el valor anteriro y el valor actual, con la formula que muestro en la columna E.

O sea:
para la celda D2= A2
para la celda D3= +D2+A3
para la celda D4= +D3+A4
para la celda D5= +D4+A5
para la celda D6= +D5+A6
para la celda D7= +D6+A7
para la celda D8= +D7+A8
para la celda D9= +D8+A9
para la celda D10= +D9+A10
para la celda D11= +D10+A11

 

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

@gusfablop 

column

CumulativeCOL A = CALCULATE(sum(Table1[Valor A]);FILTER(ALL(Table1);Table1[Valor A]<=EARLIER(Table1[Valor A])))

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

4 REPLIES 4
az38
Community Champion
Community Champion

Hi @gusfablop 

try a measure

CumulativeCOL A = 
var maxVal = max(Table1[Valor A])

return 
calculate(sum(Table1[Valor A]);
ALLSELECTED(Table1);
Table1[Valor A]<=maxVal)

thx for @Mariusz from another topic today

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Hi @az38.
As a measure, it works well, but I need it to be a calculated column.
Anyway, thank you very much for your contribution.

 

az38
Community Champion
Community Champion

@gusfablop 

column

CumulativeCOL A = CALCULATE(sum(Table1[Valor A]);FILTER(ALL(Table1);Table1[Valor A]<=EARLIER(Table1[Valor A])))

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Thank you so so so so so so so much

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.