This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hello,
I am trying to create a column that subtractrs from the previous calculated number (similar to an updating variable). I am getting confused on the DAX code.
Currently I have tried this but it did not work
Improvements =
VAR Total = Sum[table]
VAR NewTotal = Total - [Current Improvements]
Then I would like to update my total variable
Total = NewTotal
Return
Total
Hi @Anonymous ,
You can use a Var to represent the result is the same:
Improvements =
VAR Total = Sum[table] - [Current Improvements]
Return
Total
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous Nope, VAR's are not variable, they are static. I know, confusing. You can have nested VAR's that are the same name so like:
Improvements =
VAR Total = Sum[table]
VAR NewTotal = Total - [Current Improvements]
RETURN
VAR Total = NewTotal
RETURN Total
Sorry, probably confused you more.
Hi,
I have tried this DAX instead, however, I keep getting an error with my index column I created in queary editory.
@Anonymous Try:
Improvements =
SUM(DDBB[Total RPN Column])
- SUMX (
FILTER (
DDBB,
DDBB[Index]< EARLIER(DDBB[Index])
),
DDBB[Current Improvement1]
)
or maybe:
Improvements =
VAR __Index = MAX(DDBB[Index])
RETURN
SUM(DDBB[Total RPN Column])
- SUMX (
FILTER (
ALL(DDBB),
DDBB[Index]< __Index)
),
DDBB[Current Improvement1]
)
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 30 | |
| 23 | |
| 22 | |
| 16 | |
| 15 |
| User | Count |
|---|---|
| 61 | |
| 35 | |
| 28 | |
| 22 | |
| 21 |