Forum Discussion
Calculate the maximum values with a cut-off date
Hi @fjcampos,
Please check following steps as below and see if the result achieve your expectation:
1. Create calculated table as silcer:
Table 2 = DISTINCT('Table'[Date])
2. Create measures:
Measure =
CALCULATE (
MAX ( 'Table'[Date] ),
FILTER (
ALL ( 'Table' ),
'Table'[Name] = MAX ( 'Table'[Name] )
&& 'Table'[Date] <= SELECTEDVALUE ( 'Table 2'[Date] )
)
)
Measure 2 =
CALCULATE (
SUM ( 'Table'[Sales] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] = [Measure] )
)
3. Result would be shown as below:
BTW, Pbix as attached, hopefully works for you.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.