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.
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!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |