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 August 31st. Request your voucher.

Reply
Michaelc1993
New Member

How to convert weekly dates to fortnightly dates

Hi Everyone,

 

Its my first post in the forum so apologies if the post is posted incorrectly.

 

I want to convert weekly dates to fortnightly dates. While this sounds simple - I cant seem to get it working. I know there was a similar post: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Grouping-dates-into-fortnights/m-p/949837 but this didnt quite work for me as the numbers didn't while line up.

 

This is the data I have which goes up to 2023 (see below). I essentially want the 'Fortnight' column to show 06/01/21 for the first period. Then from 7/01/21 - 20/01/21 to show as 20/01/21 and 03/02/21 for the next 2 week period and so on.

 

I intially tried 

"Fortnight =
VAR __BaseDate = DATE(2021,1,6)
VAR __2w = (__BaseDate) +14

RETURN
if(Dates[Date]<=__BaseDate,__BaseDate,__2w)"
 
but ovbiously this only works for the first period. wondering if some sort of loop could be made using this? or another simpler method altogether? 

 

Michaelc1993_0-1642082706241.png

 

Any help would be greatly appreciated!

 

Kind regards,

 

Mike

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Michaelc1993 , Try a new column like

 

New column
VAR __BaseDate = DATE(2021,1,6)
return
quotient(datediff(__BaseDate,[Date],day),14) +1

 

 

if we need a yearly reset, we have start using week year start date, in place of DATE(2021,1,6)

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1

Week Start Year = minx(filter('Date',[Year] =earlier([Year])),[Week Start date])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Michaelc1993 , Try a new column like

 

New column
VAR __BaseDate = DATE(2021,1,6)
return
quotient(datediff(__BaseDate,[Date],day),14) +1

 

 

if we need a yearly reset, we have start using week year start date, in place of DATE(2021,1,6)

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1

Week Start Year = minx(filter('Date',[Year] =earlier([Year])),[Week Start date])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.