Forum Discussion
yaman123
5 years agoPost Partisan
YTD Volume
Hi, I am having an issue calculating the YTD volume from a dataset. I have a supply end date date slicer which is a between e.g user selects 01/02/2021 - 28/02/2021 I need to calculate ...
v-xulin-mstf
5 years agoCommunity Support
Hi yaman123
Create Date_slicer table as:
Date Slicer =
CALENDAR(MIN('Table'[SUPPLY_END_DATE]),MAX('Table'[SUPPLY_END_DATE]))
Try measure as:
Measure =
var min_date=
EOMONTH(MINX('Date Slicer',SELECTEDVALUE('Date Slicer'[Date],MAX('Date Slicer'[Date]))),-11)
var max_date=
MINX('Date Slicer',SELECTEDVALUE('Date Slicer'[Date],MAX('Date Slicer'[Date])))
return
CALCULATE(
MAX('Table'[COLLECTION_LITRES]),
FILTER(
('Table'),
'Table'[SUPPLY_END_DATE]<=max_date && 'Table'[SUPPLY_END_DATE]>=min_date
)
)
Here is the output:
The pbix file is attached.
Best Regards,
Link
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.