Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Max Month Year

Hi,

I've simple below table, I need new custom column with only Max (MonthYear) then show 1 else 0.

Tried this example but no luck  

LastDateInData =
IF ( Table1[OrderDate] = MAX ( Table1[OrderDate] ), 1, 0 )

My Table. Need new column with 1 or 0 values with only Max Month-Year.

 

  • Anonymous  Try using Variable or EARLIER function: 

     

    LastDateInData =
    IF ( 
    COUNTROWS( FILTER( Table1, Table1[OrderDate] > EARLIER ( Table1[OrderDate] ) ) ) =0 , 1, 0 )

2 Replies

  • AllisonKennedy's avatar
    AllisonKennedy
    Icon for Community Champion rankCommunity Champion

    Anonymous  Try using Variable or EARLIER function: 

     

    LastDateInData =
    IF ( 
    COUNTROWS( FILTER( Table1, Table1[OrderDate] > EARLIER ( Table1[OrderDate] ) ) ) =0 , 1, 0 )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

      Still I don't get correct result, some of it got but still output is not correct.

      Actually It is ignoring the previous days in the same month.

      Note: I filtered by latest MonthYear.