Forum Discussion

efilipe's avatar
efilipe
Icon for Helper IV rankHelper IV
9 years ago
Solved

Identify leap day

Hi guys,   I have a lot of erros of my CSV file because they have added unexisting dates (leap day). I have to fix it using PowerBI, since I cant touch the CSV file. Any ideas?   Thank you!   i...
  • Sean's avatar
    9 years ago

    efilipe

    I'm not sure exactly what they've added to the data - February 29th for all years?

     

    But you can create a Column in your Calendar to help you identify Leap versus Not Leap Year with this formula

    Leap/Not Leap Year =
    IF (
        OR (
            MOD ( 'Table'[Year], 400 ) = 0,
            AND ( MOD ( 'Table'[Year], 4 ) = 0, MOD ( 'Table'[Year], 100 ) <> 0 )
        ),
        "Leap Year",
        "Not a Leap Year"
    )

    Hope this helps! :smileyhappy: