Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hi
I'm trying to create the variance between actual vs budget. I have tables one for actual and another for budget, and they both have a relationship to "Date" and "Account List" tables.
I want to show the variance between actual and budget table with condition that :
If it's revenue accounts, it will do Actual less Budget,
If it's expense accounts, it will do Budget less Actual.
I tried to do a measure, but the value did not come out correctly.
Solved! Go to Solution.
Hi @Anonymous ,
We create a sample like this,
Then we can create a measure to meet your requirement.
Var $ Test =
IF(
MAX('Account List'[Type]) = "income",
SUM('actual table'[Actual]) - SUM('Budget Table'[Budget]),
SUM('Budget Table'[Budget]) - SUM('actual table'[Actual]))
The result like this,
If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data?
It will be helpful if you can show us the exact expected result based on the tables.
Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
Hi @Anonymous ,
We create a sample like this,
Then we can create a measure to meet your requirement.
Var $ Test =
IF(
MAX('Account List'[Type]) = "income",
SUM('actual table'[Actual]) - SUM('Budget Table'[Budget]),
SUM('Budget Table'[Budget]) - SUM('actual table'[Actual]))
The result like this,
If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data?
It will be helpful if you can show us the exact expected result based on the tables.
Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
@Anonymous , assuming actual and budget are measures
Var $ Test =
SUMX('Account List',
IF(('Account List'[Type])="Income",
[Actual $]-[Budget $],
[Budget $]-[Actual $]
)
)
Hi @Anonymous, create the three measures below:
Actual $ = SUM ( Actual[Amount] )
Budget $ = SUM ( Budget[Amount] )
Var $ =
VAR vAccountType =
MAX ( AccountList[AccountType] )
VAR Result =
SWITCH (
vAccountType,
"Revenue", [Actual $] - [Budget $],
"Expense", [Budget $] - [Actual $]
)
RETURN
Result
In a matrix visual, add AccountList[Account] as rows, and the three measures above as values.
Proud to be a Super User!
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 63 | |
| 43 | |
| 31 | |
| 27 | |
| 23 |
| User | Count |
|---|---|
| 134 | |
| 113 | |
| 58 | |
| 39 | |
| 35 |