Forum Discussion
bstark1287
3 years agoHelper II
Sum dollar value by open orders
I need help with some DAX. I have a working DAX that counts open orders. I am wanting to adjust this DAX to calculate total sales for open orders. I am not sure why it won't calculate. Here is the wo...
- 3 years ago
Reading the code, it looks like you are picking the date and wanting to sum the 'OB Raw Order Data'[ACT_MATERIAL_COST] where the 'OB Raw Order Data'[CREATE_DATE] is on or before the date and the 'OB Raw Order Data'[Order Closed Date] is > the 'tbl_Calendar'[End Of Month] or it is blank.
Give this measure a try and see if it is what you are looking for.
OB USB = VAR _Date = MIN ( 'tbl_Calendar'[Date] ) VAR _EoM = MIN ( 'tbl_Calendar'[End Of Month] ) RETURN CALCULATE ( SUM ( 'OB Raw Order Data'[ACT_MATERIAL_COST] ), 'OB Raw Order Data'[CREATE_DATE] <= _Date, ( 'OB Raw Order Data'[Order Closed Date] > _EoM || ISBLANK ( 'OB Raw Order Data'[Order Closed Date] ) ) )
jdbuchanan71
3 years agoSuper User
Reading the code, it looks like you are picking the date and wanting to sum the 'OB Raw Order Data'[ACT_MATERIAL_COST] where the 'OB Raw Order Data'[CREATE_DATE] is on or before the date and the 'OB Raw Order Data'[Order Closed Date] is > the 'tbl_Calendar'[End Of Month] or it is blank.
Give this measure a try and see if it is what you are looking for.
OB USB =
VAR _Date = MIN ( 'tbl_Calendar'[Date] )
VAR _EoM = MIN ( 'tbl_Calendar'[End Of Month] )
RETURN
CALCULATE (
SUM ( 'OB Raw Order Data'[ACT_MATERIAL_COST] ),
'OB Raw Order Data'[CREATE_DATE] <= _Date,
( 'OB Raw Order Data'[Order Closed Date] > _EoM || ISBLANK ( 'OB Raw Order Data'[Order Closed Date] ) )
)
bstark1287
3 years agoHelper II