Forum Discussion

bvanderwatt's avatar
bvanderwatt
Helper III
4 years ago

Ave Sales (adding a filter)

Hi 

 

I recently added a filter in my Nsls column, which now consists of the type of orders. 

 

How would I add a filter to the below formula if I wanted to limited to only "HQ Sales?"

 

Ave Qty Sold (Last 3 months) =
var _LastMonthEnd = CALCULATE (
MAX ( 'Calendar'[Date] ),
FILTER (
ALL ( 'Combined Sales' ),
'Combined Sales'[QtyInvoiced] <> BLANK ()
&& 'Combined Sales'[InvoiceDate] <= EOMONTH ( TODAY (), -1 )
)
)

RETURN
CALCULATE(
SUM('Combined Sales'[QtyInvoiced]),
DATESINPERIOD('Calendar'[Date], _LastMonthEnd, -3, MONTH)
)/3.0

1 Reply