Forum Discussion
Using active and inactive in one measure
- 4 years ago
OK, try
Turnover MTD = var mtd = DATESMTD( 'Calendar'[Date]) return CALCULATE( SUM('Table'[Turnover]), REMOVEFILTERS('Calendar'), TREATAS( mtd, 'Table'[Order date]), TREATAS( mtd, 'Table'[Delivery date]) )You may need to alter the REMOVEFILTERS if the order day & month aren't coming from the Calendar table.
Sorry my last post was not regarding DAX studio. I was typing whilst you already answered. I don't have DAX studio and cannot install on my business laptop.
However I found out the formula shows only the lines order date of the selected calendar day. Example:
The measure shows 435€, but it should shows 1690.
OK, try
Turnover MTD =
var mtd = DATESMTD( 'Calendar'[Date])
return CALCULATE( SUM('Table'[Turnover]),
REMOVEFILTERS('Calendar'),
TREATAS( mtd, 'Table'[Order date]),
TREATAS( mtd, 'Table'[Delivery date])
)You may need to alter the REMOVEFILTERS if the order day & month aren't coming from the Calendar table.
- bendejnp4 years ago
Helper I
With the suggested change it works now. Thank you!
However, I didn't understand which the "removefilter" has and why I have to use it here 😄- johnt754 years ago
Super User
REMOVEFILTERS is to make sure that nothing is being filtered out by any slicers or filters applied to the calendar table.
- bendejnp4 years ago
Helper I
Ok I see. So since the latest day is selected in the dashboard, it will only sum up the selected day. Thanks for the explanation.