Help with DAX Formula to handle Sumproduct type solution

Dman333

Board Regular
Joined
Sep 30, 2016
Messages
68
Office Version
  1. 365
Platform
  1. Windows
Hello all;

I'm having trouble figuring out how to formulate the correct DAX formula - if that's what I need. Below is a really simplified example of what I'm trying to achieve. I have two different sources of budget information and used power pivot to get them to line up by creating an index table and linking it to two other tables that each have different budgets for the same task. There are hundreds of rows in each of the tables and there can be multiple lines with the same "business unit" and "cost code" combination. In excel I would use sumproduct as done in the example below. Essentially, I want to be able to find the variance between two numbers based on multiple rows that meet certain criteria. If anyone can point me in the right direction such as possible nesting combinations or other formulas it would be greatly appreciated. I'm pretty new to DAX.
Thanks,
Dman333

Book2
ABCDEFGHIJ
1Budget #1 InternalBudget #2 ExternalBus Unit Summary
2
3Business UnitCost CodeBudgetBusiness UnitCost CodeBudgetBus UnitVariance
4
51002000110010020001110100-33
6100200021501002000214520023
710020003125100200031283000
81002000415010020004170
91002000517510020005180
102002000110020020001102
112002000215020020002140
122002000312520020003120
132002000415020020004140
142002000517520020005175
153002000110030020001100
163002000215030020002150
173002000312530020003125
183002000415030020004150
193002000517530020005175
Sheet8
Cell Formulas
RangeFormula
J5:J7J5=SUMPRODUCT((($A$5:$A$19=I5)*($C$5:$C$19))-(($E$5:$E$19=I5)*($G$5:$G$19)))
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
That looks like two simple sum measures (one for the budget in each table) then create a third measure that is just one subtracted from the other.
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,270
Members
452,628
Latest member
dd2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top