Maxdate comparison DAX Calculation Help

HI Team,

Need help in DAX Calculation below is my issue

Need to compare each and every date with my Max date in my dataset

i tried below formula but its throwing me error " Expression refer to multiple columns.Multiple columns cannot be converted to scalar value"

any help would be highy appreciated

Formula

CALCULATE([Total Revenue],FILTER(‘Date’,‘Date’<= MAXX(‘Date’,‘Date’[Day])&& ‘Date’[Date]>= MAXX(‘Date’,‘Date’[Date])-[TimeFrame Selected Value]))

Hi @varuntableau5,

I formatted your measure, which makes it easier to read.

CALCULATE(
    [Total Revenue],
    FILTER( 'Date',
      'Date' <= MAXX( 'DATE', 'DATE'[Day] ) &&
      'DATE'[Date] >= MAXX( 'DATE', 'DATE'[Date] ) - [TimeFrame Selected Value]
    )
) 

This reveals a potential issue in the DAX code, for example the first line in FILTER should probably be: ’DATE'[Date] <= MAXX( 'DATE', 'DATE'[Date] )

I hope this is helpful.