Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Switch Function for Tollgate Dates

Can anyone help me trouble shoot the issue I'm having with this Power BI formula? It's worked perfectly all year but now dates are going into next year I'm having issues. I have a column with the fir...
  • v-yalanwu-msft's avatar
    4 years ago

    Hi, Anonymous ;

    You could modify it.

    End = 
    SWITCH (
        'Table'[Tollgate],
        "Tollgate 4", 'Table'[week date] + 139,
        "Tollgate 3", 'Table'[week date] + 83,
        "Tollgate 2", 'Table'[week date] + 55,
        "Tollgate 1", 'Table'[week date] + 27,
        "Tollgate 0", 'Table'[week date] + 6
    )

    Or use calendar date.

    The final output is shown below:

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.