Forum Discussion

StephenK's avatar
StephenK
Icon for Resolver I rankResolver I
6 years ago
Solved

Calculating Flu Season from Date Table

Hey all,   I have a date table containing all dates within the last 3 years. I need to create a calculated column either in power query or dax that identifies the flu season. So for dates between 1...
  • mahoneypat's avatar
    mahoneypat
    6 years ago

    This column expression should work in your Date table

     

    Flu Season =
    SWITCH (
    TRUE (),
    Flu[Month] <= 3, YEAR ( Flu[Date] ) - 1 & "-"
    & YEAR ( Flu[Date] ),
    Flu[Month] >= 10, YEAR ( Flu[Date] ) & "-"
    & YEAR ( Flu[Date] ) + 1,
    "Off Season"
    )

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat