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!
Greetings All,
Needing some help here. Using a SWITCH function I created my rows. I am having difficultly creating the "Net" portion for the rows. Anytime I try to add/subtract in the SWITCH it gives me errors. I've spent a couple of days trying different examples I found online and have not been able to resolve my issue.
Any help would be greatly appreciated.
ie: "Freight in Expense" - "Freight in Income" = "Net Freight in Expense"
This is what I want it to look like:
Here is my SWITCH:
VAR _FiE = 'TableA'[AcctNbr] = "1111"
VAR _FiI = 'TableA'[AcctNbr] IN { "5555", "6666"}
VAR _DI = 'TableA'[AcctNbr] IN { "8888", "7777" }
VAR _DE = 'TableA'[AcctNbr] IN { "2222", "3333"}
RETURN
SWITCH(
TRUE(),
_FiE, "Freight Income",
_FiI, "Freight Expense",
_FiE-_FiI, "Net Freight Expense”,
_DI, "Delivery Income",
_DE, "Delivery Expense",
_DE-_DI, "Net Delivery Expense"
)
Thank you.
Solved! Go to Solution.
I resolved my issue. I used a disconnected table and built a measure to complete my calculations.
I resolved my issue. I used a disconnected table and built a measure to complete my calculations.
could you pls provide some sample data? how many tables do you have?
Proud to be a Super User!
Hi,
just add another variable that does the subtraction. you can't do a subtraction in your statement you can't say if A is subtracted by B then it is A-B".
Thanks,
B
VAR _Subtract = _FiE-_FiI
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 |
|---|---|
| 61 | |
| 48 | |
| 35 | |
| 25 | |
| 23 |
| User | Count |
|---|---|
| 134 | |
| 110 | |
| 59 | |
| 39 | |
| 32 |