I am not sure how your data model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
Sales on or before slicer: =
VAR _slicerdate =
MAX ( 'Slicer table'[Date] )
SUM ( Sales[Sales] ),
KEEPFILTERS ( 'Calendar'[Date] <= _slicerdate )
Index expected result: =
VAR _startdate =
CALCULATE ( MIN ( Sales[Date] ), ALL ( 'Calendar' ) )
VAR _monthyearbyproducttable =
SUMMARIZECOLUMNS ( 'Calendar'[Month-Year], 'Calendar'[Month-Year sort] ),
FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] >= _startdate )
NOT ISBLANK ( [Sales on or before slicer:] )
&& HASONEVALUE ( 'Calendar'[Month-Year] ),
ORDERBY ( 'Calendar'[Month-Year sort], ASC )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Go to My LinkedIn Page