Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
efilipe
Helper IV
Helper IV

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!

 

if ([ANO_NASCIMENTO] > 2000) then "" else if Date.FromText([DAYDATE] & "/" & [MONTHDATE] & "/" & [YEARDATE]) else ""

 

Thank you!

Edgard

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

@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! Smiley Happy

View solution in original post

1 REPLY 1
Sean
Community Champion
Community Champion

@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! Smiley Happy

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.