Forum Discussion
Fiscal Calendar Month Calculation
- Anonymous1 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.
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.
Anonymous ,
Awsom !!!
This is working as expected, Hope I can change my end date calendar as per the requirmnet and hope that will not change the calculations ?
Thank you soo much !!!