Forum Discussion
prior negative balances
why does 2034 and 2035 have taxable negative income but 2023 (for example ) does not?
In any case - Power BI has no memory and has no concept of variables. You cannot solve this in DAX. It might be possible to do it in Power Query as List.Accumulate is a bit more powerful than SUMX. But in general you should not be using Power BI for these complex state based computations.
Thank you for your interest.
Year 2023 is the first in the series: even if it was a profit year, there's no previous result to compensate with.
Years 2034 or 2035 are profit years. In any given profit year, prior negative results can be compensated with positive current result. For instance, in 2024 the whole loss from 2023 is applied; the same goes with 2027 against 2026. Year 2030 makes some different case: current profit is not enough to cover the whole loss from 2029: therefore the excess can be applied to futher years profit.
I hope my answer is clear enough. Should you neeed further clarification, please do not hesitate to ask again.