Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Fiscal Calendar Month Calculation

Team, I am creating a Fiscal Cal Table where in Start date is from 04/02/2024 to 01/02/2024 for CY and next year it starsts from 02/02/2025 and goes on.  attaching the screen shot for the same. I n...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Anonymous ,

     

    You can create a calculated table.

    Table = 
    VAR _vtable1 =
        ADDCOLUMNS (
            CALENDAR ( "2024-1-1", "2025-2-28" ),
            "_Rank",
                RANKX (
                    FILTER (
                        CALENDAR ( "2024-1-1", "2025-2-1" ),
                        MOD ( DATEDIFF ( "2024-2-3", [Date], DAY ), 7 ) = 0
                    ),
                    [Date],
                    ,
                    ASC
                )
        )
    RETURN
        SELECTCOLUMNS (
            ADDCOLUMNS (
                _vtable1,
                "month",
                    FORMAT (
                        MINX ( FILTER ( _vtable1, [_Rank] = EARLIER ( [_Rank] ) ), [Date] ),
                        "mmmm"
                    )
            ),
            [Date],
            [month]
        )

     

    Then create a calculated column.

    Year = 
    IF([month] = "January",YEAR([Date]) - 1, YEAR([Date]))

     

    If your Current Period does not refer to this, please clarify in a follow-up reply.

     

    Best Regards,

    Clara Gong

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.