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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
RichOB
Helper IV
Helper IV

Need help to calculate the variance

Hi, 

 

I have merged a budget and balance report but I now need need to show the variance in a column next to the budget.

 

Here's how the page looks:

BalBudge2.png

Here's a snapshot of the worksheet columns. The balance and budget are in the same column for merging purposes. Not sure if that matters. There are 25 different categories not just the "Contract Income" above:

 pbicolumns.png

Thanks in advance!

1 ACCEPTED SOLUTION

Is this what you were looking for? You can simply create a measure for Balance and another one for Budget and add them to the matrix table.

 

If this is the solution then please mark it accordingly.

 

Screenshot 2024-03-25 175546.jpg



If the post helped then please give it a Kudos and mark it as the solution so others can see it.
Cheers,

View solution in original post

10 REPLIES 10
RichOB
Helper IV
Helper IV

thanks for your help, here's the table format:

 

Budgetpbi.pngbalancepbi.png

 

 

 

 

 

 

 

 

 

 

You attached screenshots again. Use the below:

Screenshot 2024-03-25 150018.jpg



If the post helped then please give it a Kudos and mark it as the solution so others can see it.
Cheers,

Ah sorry here you go

 

Scheme NameCategoryAmountQuarterType
Bridgend StepdownContract Income3053.22Q1Budget
Bridgend StepdownContract Income3053.22Q1Budget
Bridgend StepdownContract Income3053.22Q1Budget
Bridgend StepdownContract Income3053.22Q2Budget
Bridgend StepdownContract Income3053.22Q2Budget
Bridgend StepdownContract Income3053.22Q2Budget
Bridgend StepdownContract Income3053.22Q3Budget
Bridgend StepdownContract Income 3053.22Q3Budget
Bridgend StepdownContract Income 3053.22Q3Budget

 

Bridgend StepdownContract Income9159.68Q1Balance
Bridgend StepdownContract Income3053.23Q2Balance
Bridgend StepdownContract Income3052.23Q2Balance
Bridgend StepdownContract Income3953.23Q2Balance
Bridgend StepdownContract Income4610Q2Balance
Bridgend StepdownContract Income4610Q2Balance
Bridgend StepdownContract Income4610Q3Balance
     
     
     

Is this what you were looking for? You can simply create a measure for Balance and another one for Budget and add them to the matrix table.

 

If this is the solution then please mark it accordingly.

 

Screenshot 2024-03-25 175546.jpg



If the post helped then please give it a Kudos and mark it as the solution so others can see it.
Cheers,

This worked perfectly, thanks for your patience and help! Rich

MNedix
Super User
Super User

Hi,

Variance of what-against-what? Balance-Budget or Balance Q1-Balance Q2 or something else? Do you have measures behind Balance and Budget or are they just labels? 



If the post helped then please give it a Kudos and mark it as the solution so others can see it.
Cheers,

Hi @MNedix 

 

It would be the balance figure minus the budget figure. There aren't any measures behind the balance and budget, I just named them that to differentiate what they are.

 

Thanks

 

 

Then a simple measure could probably do the job (replace 'Table' with your table):

 

Variance = 
VAR _balance = CALCULATE(SUM('Table'[Amount]),'Table'[Type]="Balance")
VAR _budget = CALCULATE(SUM('Table'[Amount]),'Table'[Type]="Budget")
RETURN
_balance - _budget

 

Then add the measure to the table visual. But keep in mind that this assumes that in Column Type you have both Balance and Budget (at least this is what I understood from your screeshot).

 

If this solved your problem pleae mark it as the solution.



If the post helped then please give it a Kudos and mark it as the solution so others can see it.
Cheers,

Hi @MNedix thanks for your reply. I've got the variance in the table now but it's coming up twice. Any ideas how I can change this to show just one on the far right column please?

 

Variancepbi.png

 

 

I don't really understand where the Amount and Variance Amount are coming from in the Values of your matrix. Can you paste your initial data in table format so I can try replicating your problem (you only put a screenshot)?



If the post helped then please give it a Kudos and mark it as the solution so others can see it.
Cheers,

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.