Forum Discussion

Luis_Caston's avatar
Luis_Caston
Icon for Helper III rankHelper III
1 year ago
Solved

Date year periods

Dear all! I need you support please! I want to define year periods according a date range. Ranges are: From: 01/08 (first year) Until: 31/07 (last year) So for example if date range is: 0...
  • ryan_mayu's avatar
    ryan_mayu
    1 year ago

    Luis_Caston 

    pls try if this is what you want.

     

    Column = if(month('Rango años'[Fecha])<9,year('Rango años'[Fecha])-1&"/"&year('Rango años'[Fecha]),year('Rango años'[Fecha])&"/"&year('Rango años'[Fecha])+1)
     
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi, Luis_Caston 

    Thanks for ryan_mayu's reply. You can try the following measure.

    Period Year test =
    IF (
        FIRSTDATE ( Calendario[Fecha] ) > 01 / 08
            || FIRSTDATE ( Calendario[Fecha] ) < 31 / 07,
        YEAR ( LASTDATE ( Calendario[FechaFiscal] ) ) - 1 & "/"
            & YEAR ( LASTDATE ( Calendario[FechaFiscal] ) ),
        "Luis"
    )
    

     

    Best Regards,
    Yang
    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum