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
CassieM
New Member

Calculate the difference between 2 vlaues in a table visual in a report

Hello,

I am (really) new to Power BI and I apologise in advance if this has already been answered somewhere but I couldn't find it.

 

I have 2 tables:

1) Expense table
BI-Expenses-tbl-2019-02-05_8-10-21.jpg

 

 

 

 

 

 

 

 

 

 

 

2) Budget table

bBI-budger-tbl-2019-02-05_8-14-21.jpg

 

They have a relationship on (Budget tbl) Category -> (Expenses tbl) Categories. 1 to many

 

BI-relationship-2019-02-05_8-15-42.jpg

 

I have a table visual that totals the budgeted amount against the amount spent:

BI-table-visual-2019-02-05_8-16-40.jpg

 

I want to add a column called "Balance" to the table visual above that shows the difference between the "Sum amount budgeted (USD)" and the "Amount spent (USD)", as per mockup below:

BI-table-visual-BALANCE-2019-02-05_8-16-40.jpg

 

In Excel, that would be very easy to do.

I've tried different Quick Measures but I've not been successful.

I would appreciate some help please.

 

Thank you

1 ACCEPTED SOLUTION

In your table pull in only

  • Category from your budget table
  • Total Spent
  • Total Budget
  • Balance

View solution in original post

6 REPLIES 6
jdbuchanan71
Super User
Super User

You will want to write a couple measures.

 

Total Spent = SUM ('Actuals'[Amount Spent (USD)])

Total Budget = SUM ('Budget'[Amount Budgeted (USD)])

 

Then a measure to calculate the balance using our first 2 measures.

Balance = [Total Budget] - [Total Spent]

 

You can  pull these measures into a report along with your Category field from the Budget table.

thanks jdbuchanan71.

 

How do I get rid of the duplicates - see below - please?:

 

BI-duplicates-2019-02-05_9-18-06.jpg

 

thank you

In your table pull in only

  • Category from your budget table
  • Total Spent
  • Total Budget
  • Balance

Yeah! Thank you so much! Cat Happy

 

I really need to take a course!!

There is a lot of good and free stuff out there.  Take a look at this to start with.

 

https://www.youtube.com/watch?v=klQAZLr5vxA

 

It is an DAX 101 lecture on the PowerBI youtube cannel.

thank you! I will 🙂

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.