Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 64 | |
| 31 | |
| 29 | |
| 24 |