Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Last 5 weeks show value as 1

Hi Experts

 

need a calculated column measure to show one if the date is in the last 5 weeks. See image i have the following calculated column measure but it goes beyond 5 weeks, based on todays date and week num

 

 

  • and try this

    Column = IF([Date] <= TODAY()&&
    [Date] >= TODAY()-30,1,0)

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi - Slights confused - can you kindly right the full dax please.

  • sorry this corrected cod

    Column = 
    VAR _CurrentWeek = WEEKNUM(TODAY(),2)
    VAR _WeekNumber = WEEKNUM([Date],2)
    RETURN
    IF(_WeekNumber<=_CurrentWeek&&_WeekNumber>=_CurrentWeek-4,1,0)
    • Ahmedx's avatar
      Ahmedx
      Icon for Super User rankSuper User

      and try this

      Column = IF([Date] <= TODAY()&&
      [Date] >= TODAY()-30,1,0)