Forum Discussion

sajal161292's avatar
sajal161292
Helper V
8 years ago
Solved

To create groups on date table

Hi,   I have  a calendar table as described below:     I would like to create groups on it like :   if calendar[date] = today  then "0 day" else if calendar[date] between today+1 and tod...
  • Anonymous's avatar
    Anonymous
    8 years ago

    Try this:

     

    Column = 
    VAR diff = Calendar[Date] - TODAY()
    RETURN
        SWITCH(TRUE(),
            diff < 0, BLANK(),
            diff = 0, "0 days",
            diff <= 10, "1-10 days",
            diff <= 20, "11-20 days",
            diff <= 30, "21-30 days",
            "> 30 days"
        )