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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.