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.
Hello everyone,
I need help with this, I need to create a new column that sums row by row historically from a specific column i.e,
A / B
1 / 1
2 / 3
-1 / 2
-3 / -1
6 / 5
...
How can I get the column B from column A?
Solved! Go to Solution.
Hi @lonerwalker
You need to add a date column or index column to compare.
If you want compare by a index column, try this,
Then, use the measure to calculate the total
total =
var _ind=SELECTEDVALUE('Table'[Index])
return
CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[Index]<=_ind))
Result:
OR
If you want compare by a Date column, try this,
total =
var _ind=SELECTEDVALUE('Table'[date])
return
CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[date]<=_ind))
Result:
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @lonerwalker
You need to add a date column or index column to compare.
If you want compare by a index column, try this,
Then, use the measure to calculate the total
total =
var _ind=SELECTEDVALUE('Table'[Index])
return
CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[Index]<=_ind))
Result:
OR
If you want compare by a Date column, try this,
total =
var _ind=SELECTEDVALUE('Table'[date])
return
CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[date]<=_ind))
Result:
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
@lonerwalker when you say historically, I am assuming there a date column in your data that you can be used to identify which transaction came first. In that case you can use @Greg_Deckler suggestion but replace the index column with your date column
@lonerwalker Well, you would want to add an Index column and then you could do something like the following:
B = SUMX(FILTER('Table',[Index] < EARLIER('Table'[Index])),[A])
@Greg_Deckler I tried your formula but return this, the column is called "Columna", "Fecha de entrega" is a date column and "evolucion de stock" is the column used to SUMX. Also, I Filter by product in "producto terminado" for see the data.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.