Forum Discussion
YTD last year DAX
I have YTD and last year YTD in different columns and how can I see YTD value for 2017 and 2018 when the year 2018 is selected in a year slicer?
- Anonymous7 years ago
Hi Anonymous,
It seems like your records are in same table, maybe you can use 'all' function to replace 'all selected' to break current filter effect to let formula calculate on whole table:
Utfall YTDLY = CALCULATE ( SUM ( 'Transaktion'[konto] ), FILTER ( ALL( 'Transaktion' ), [Datum] >= DATE ( YEAR ( TODAY () ) - 1, 1, 1 ) && [Datum] <= ( DATE ( YEAR ( TODAY () ) - 1, MONTH ( TODAY () ), 1 ) - 1 ) ) )Regards,
Xiaoxin Sheng
6 Replies
- AnonymousNot applicable
Hi Anonymous,
You can use date and YTD columns to create table visual, then write a measure to look up last year YTD column and add it to current visual.
Share some data if you confused on coding formula.
Regards,
Xiaoxin Sheng
- AnonymousNot applicable
- AnonymousNot applicable
Anonymous
I want to get YTD values from January till the end of last month so I used the following formula to create a measure for YTD and YTD LY
Utfall YTD = CALCULATE(SUM('Transaktion'[konto]),FILTER('Transaktion',[Datum]>=DATE(YEAR(TODAY()),1,1) && [Datum] <=(DATE(YEAR(TODAY()),MONTH(TODAY()),1)-1)))
Utfall YTD LY= CALCULATE(SUM('Transaktion'[konto]),FILTER('Transaktion',[Datum]>=DATE(YEAR(TODAY())-1,1,1) && [Datum] <=(DATE(YEAR(TODAY())-1,MONTH(TODAY()),1)-1)))