Forum Discussion
How to calculate Budget Variance conditionally?
Hi all,
I have been building an income statement within powerbi, but I have run in trouble when adding a budget variance column.
I want to structure my variance measure to where if it's a positive variance then it's favorable and a negative variance it's unfavorable. I have included some sample data below.
You will see that the variance calculation works for the revenue line (actuals were less than budget so I want to show negative), but the signs are flipped for all of the expense categories, obviously.
Is there a way to add a condition within the variance measure to say "if it's revenue, then do $ Act - $ Bud, if not then $ Bud - $Act?
The short answer is yes, there are many ways to do what you are asking. The actual solution that works for you will depend on how your data is organized.
A quick example of how it could work;
If your line items have a coresponding column that determines revenue or expense (or are related to a column). You would then be able to use that column in a variance measure.If I have the line items and coresponding account type
I can then write a variance measure like
That would give me a result like
Hope this gets you going in the right direction.
1 Reply
- jgeddesSuper User
The short answer is yes, there are many ways to do what you are asking. The actual solution that works for you will depend on how your data is organized.
A quick example of how it could work;
If your line items have a coresponding column that determines revenue or expense (or are related to a column). You would then be able to use that column in a variance measure.If I have the line items and coresponding account type
I can then write a variance measure like
That would give me a result like
Hope this gets you going in the right direction.