SUMIFS in DAX

Pingie

New Member
Joined
Nov 20, 2019
Messages
4
I want to add a column or measue that would do the same as the excel function:
sumifs(Net tons PY, [Column] Article,[Row in column Article] article number, [Column] Workcenter, [Row in colum workcenter] Workcenter).

Summarized: i need the tons based on the criteria that its suppose to be in de same article & workcenter.

I have been using DAX since a couple of weeks, so untill now i only know the SUM & DIVIDE function. I tried working with CALCULATE but was not able to get it working.

Does anyone know how i can make this work?


1575016204456.png
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
CALCULATE is the correct command. I'm not sure if you want the IFs to be hardcoded or based on something else.

So, a simple example would be

[Tons PY] :=
CALCULATE (
SUM ( HKSIV[Net tons PY] ),
HKSIV[Article Descr] = "Tork XPN...",
HKSIV[Work center] = "Bretting 12",
...
)

If you're using slicers on the various columns then a simple SUM would be sufficient.
 
Upvote 0
Yes, but the lookup filter should be dynamic, so no specific reference to Tork XPN, or Bretting. In excel it will just refer to a cell that is not absolute. Will that work in Dax?
 
Upvote 0
At its simplest, the basic SUM measure for your PY Net Tons is dependent upon any filter or row context in your pivot table. So if you have a measure for [Tons PY] := SUM ( HKSIV[Net tons PY] ), then have slicers to pick any of the values from your other columns, or if you add the column (e.g. Article Descr) to the pivot table, the measure will automatically show you how many for that filter condition.
 
Upvote 0

Forum statistics

Threads
1,214,406
Messages
6,119,330
Members
448,888
Latest member
Arle8907

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