Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cartergardner
Regular Visitor

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.  

 

cartergardner_1-1664392198844.png

 

 

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?

 

   

1 ACCEPTED SOLUTION
jgeddes
Super User
Super 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

jgeddes_0-1664396200241.png

I can then write a variance measure like

jgeddes_1-1664396265005.png

That would give me a result like

jgeddes_2-1664396287331.png

Hope this gets you going in the right direction.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

1 REPLY 1
jgeddes
Super User
Super 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

jgeddes_0-1664396200241.png

I can then write a variance measure like

jgeddes_1-1664396265005.png

That would give me a result like

jgeddes_2-1664396287331.png

Hope this gets you going in the right direction.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.