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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
mcor13
Regular Visitor

Calculate Financial Period End Date

Hi

I'm tring to add a calculated column to a date table to define the financial period for a year that starts 1st April.

 

Period 1 ends on the 4th Saturday of April then periods end using the following 

 

24 weeks
35 weeks
44 weeks
54 weeks
65 weeks
74 weeks
84 weeks
95 weeks
104 weeks
114 weeks
12all days up to 31st March

 

I was thinking that if I could define the 4th Saturday of the year , anything less than or equal to that would be P1, 

then anything less than P1 + 28 would be P2 etc....

 

Any help or suggestions would be very much appreciated.

 

Thanks

 

 

1 ACCEPTED SOLUTION
Gabry
Super User
Super User

Hey buddy,

could you try this?

Period = 
VAR ThisDate      = 'Date'[Date]

VAR FY            = YEAR(ThisDate) - IF(MONTH(ThisDate) < 4, 1, 0)


VAR StartOfFY     = DATE(FY, 4, 1)


VAR FirstSaturday =
    StartOfFY +
    MOD(6 - WEEKDAY(StartOfFY, 2), 7)


VAR FourthSaturday = FirstSaturday + 21


VAR BoundP1  = FourthSaturday
VAR BoundP2  = BoundP1  + 28
VAR BoundP3  = BoundP2  + 35
VAR BoundP4  = BoundP3  + 28
VAR BoundP5  = BoundP4  + 28
VAR BoundP6  = BoundP5  + 35
VAR BoundP7  = BoundP6  + 28
VAR BoundP8  = BoundP7  + 28
VAR BoundP9  = BoundP8  + 35
VAR BoundP10 = BoundP9  + 28
VAR BoundP11 = BoundP10 + 28

VAR BoundP12 = DATE(FY + 1, 3, 31)


RETURN
    SWITCH(
        TRUE(),
        ThisDate <= BoundP1,  1,
        ThisDate <= BoundP2,  2,
        ThisDate <= BoundP3,  3,
        ThisDate <= BoundP4,  4,
        ThisDate <= BoundP5,  5,
        ThisDate <= BoundP6,  6,
        ThisDate <= BoundP7,  7,
        ThisDate <= BoundP8,  8,
        ThisDate <= BoundP9,  9,
        ThisDate <= BoundP10, 10,
        ThisDate <= BoundP11, 11,
      
        12
    )

View solution in original post

3 REPLIES 3
Gabry
Super User
Super User

Hey buddy,

could you try this?

Period = 
VAR ThisDate      = 'Date'[Date]

VAR FY            = YEAR(ThisDate) - IF(MONTH(ThisDate) < 4, 1, 0)


VAR StartOfFY     = DATE(FY, 4, 1)


VAR FirstSaturday =
    StartOfFY +
    MOD(6 - WEEKDAY(StartOfFY, 2), 7)


VAR FourthSaturday = FirstSaturday + 21


VAR BoundP1  = FourthSaturday
VAR BoundP2  = BoundP1  + 28
VAR BoundP3  = BoundP2  + 35
VAR BoundP4  = BoundP3  + 28
VAR BoundP5  = BoundP4  + 28
VAR BoundP6  = BoundP5  + 35
VAR BoundP7  = BoundP6  + 28
VAR BoundP8  = BoundP7  + 28
VAR BoundP9  = BoundP8  + 35
VAR BoundP10 = BoundP9  + 28
VAR BoundP11 = BoundP10 + 28

VAR BoundP12 = DATE(FY + 1, 3, 31)


RETURN
    SWITCH(
        TRUE(),
        ThisDate <= BoundP1,  1,
        ThisDate <= BoundP2,  2,
        ThisDate <= BoundP3,  3,
        ThisDate <= BoundP4,  4,
        ThisDate <= BoundP5,  5,
        ThisDate <= BoundP6,  6,
        ThisDate <= BoundP7,  7,
        ThisDate <= BoundP8,  8,
        ThisDate <= BoundP9,  9,
        ThisDate <= BoundP10, 10,
        ThisDate <= BoundP11, 11,
      
        12
    )

That's worked nicely. Thank you @Gabry Your help is very much appreciated. 

lbendlin
Super User
Super User

These dates are immutable. There is no point to do this in DAX or Power Query.  Use an external, precomputed reference table.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.