Forum Discussion
Calculate Order Value Total ($) When Containing Item used in Filter - Duplicate Order #'s in system
Then just add a filter condition for the year to the query.
Measure = VAR _orders=VALUES(Orders[OrderId]) return CALCULATE(SUM(Orders[Sales]),FILTER(ALL(Orders),Orders[OrderId] in _orders && Orders[Date]>=DATE(2019,7,11)))
Thanks that does work but I want to avoid hardcoding dates because I want the measure to be reausable. I have the date filter already on my report as well.
- Cmcmahan7 years ago
Resident Rockstar
So then replace the hardcoded value with a measure or expression that returns the date from your date filter.
Measure = VAR _orders=VALUES(Orders[OrderId]) VAR _curDate = SELECTEDVALUE(Orders[Date]) RETURN CALCULATE(SUM(Orders[Sales]),FILTER(ALL(Orders),Orders[OrderId] in _orders && Orders[Date]>=_curDate))
- v-lili6-msft7 years ago
Community Support
hi, USABB_Data
If possible, could you share your simple sample pbix file for us have a test?
Best Regards,
Lin
- USABB_Data7 years ago
Helper II
I don't have Dropbox but hopefully the screenshots will provide more clarity.
Used your demo and created an Order Date table with a duplicate OrderID of 2 to mimmick our setup (1st screenshot). Then I filter the Order Date to just 7/11/2019 (2nd screenshot). I want the measure to now show just 75 because that's the total for the measure on 7/11/2019 and the 5/15/2019 data is irrelevant.