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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Calculate a bi-weekly date range column

Hi all, 

 

I'm trying to add a date range column that would calculate every 2 weeks (starting on a Monday). e.g. 06/09/2021 - 19/09/2021 etc.

Ideally I would also like it to have a custom start date, as the bi-weekly date ranges are related to target setting (which haven't been done yet), so if targets are set on the 13th of September, the date range column can start 13/09/21 - 26/09/2021, and continue every two weeks from there for the rest of the year. 

 

My date table currently looks like this: 

daviesn_0-1630513821792.png

 

I got as far as adding the 'calendar week date range' column using this formula: https://community.powerbi.com/t5/Desktop/Create-date-range-column-for-weeks-in-DAX/m-p/618265 but can't figure out a workaround to make that bi-weekly instead of weekly. 

 

Any help would be much appreciated!! thank you. 

1 ACCEPTED SOLUTION

@Anonymous Maybe:

Column = 
  VAR __Week = [Week Number]
  VAR __Year = [Year]
  VAR __Min = MINX(FILTER('Table',[Week Number] = __Week && [Year] = __Year),[Date])
  VAR __Max = MAXX(FILTER('Table',[Week Number] = __Week && [Year] = __Year),[Date])
RETURN
  __Min & "-" & __Max


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Greg_Deckler thanks so much for the reply! Could you explain that a bit more please? at the moment it's giving me a range from my min to max date in the whole date table:

daviesn_0-1630577284077.png

Column =
VAR __Week = [Week Number]
VAR __Min = MINX(FILTER('Date', [Week Number] = __Week),[Date])
VAR __Max = MAXX(FILTER('Date',[Week Number] = __Week),[Date])
RETURN
__Min & "-" & __Max

@Anonymous Maybe:

Column = 
  VAR __Week = [Week Number]
  VAR __Year = [Year]
  VAR __Min = MINX(FILTER('Table',[Week Number] = __Week && [Year] = __Year),[Date])
  VAR __Max = MAXX(FILTER('Table',[Week Number] = __Week && [Year] = __Year),[Date])
RETURN
  __Min & "-" & __Max


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@Anonymous Well, maybe something along the lines of:

Column = 
  VAR __Week = [Week Number]
  VAR __Min = MINX(FILTER('Table',[Week Number] = __Week),[Date])
  VAR __Max = MAXX(FILTER('Table',[Week Number] = __Week),[Date])
RETURN
  __Min & "-" & __Max


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors