Forum Discussion
Why doesn't it work? YTD - max (date) vs custom column max (date)
So I'm trying to create a YTD measure and this is :
Hi DouweMeer,
In your first formula, we can only get the max year or the current row by max ( [INVOICE_DT] ). So we should update your formula as below.
Sales this year = VAR _maxyear = YEAR ( MAXX ( ALL ( yourTABLE ), [INVOICE_DT] ) ) RETURN CALCULATE ( SUM ( 'Price_Realisation'[USD Conversion] ), FILTER ( 'Price_Realisation', 'Price_Realisation'[YTD year] = _maxyear ) )If any other issue, kindly share your sample data and excepted result to me, if you don't have confidential data? Please upload your file to One Drive and share the link here.
Regards,
Frank
2 Replies
- v-frfei-msft
Community Support
Hi DouweMeer,
In your first formula, we can only get the max year or the current row by max ( [INVOICE_DT] ). So we should update your formula as below.
Sales this year = VAR _maxyear = YEAR ( MAXX ( ALL ( yourTABLE ), [INVOICE_DT] ) ) RETURN CALCULATE ( SUM ( 'Price_Realisation'[USD Conversion] ), FILTER ( 'Price_Realisation', 'Price_Realisation'[YTD year] = _maxyear ) )If any other issue, kindly share your sample data and excepted result to me, if you don't have confidential data? Please upload your file to One Drive and share the link here.
Regards,
Frank
- DouweMeer
Impactful Individual
That actually looks very logical. I notice more and more that even though DAX looks a lot like Excel, it isn't Excel :). Thanks.