cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Grouping dates into fortnights

Hi everyone,

 

I'm looking for a solution that will help in grouping dates into fortnights, irregardless of month or year. I'll attach an image to help understand what I am meaning.

 

It wouldn't matter if the column started at calendar start or a specific date.

 

The date table I have is just an invoked funtion in M.

 

Hopefully someone can help, I'm not sure what other information I could provide that would be helpful here.

 

Dates for CN.jpg

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

I'm thinking:

 

Fortnight = 
  VAR __BaseDate = DATE(2019,1,1)
  VAR __Days = ([Value].[Date] - __BaseDate) * 1.
RETURN
  INT(__Days/20) + 1

 

Attached PBIX. 


@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Super User
Super User

I'm thinking:

 

Fortnight = 
  VAR __BaseDate = DATE(2019,1,1)
  VAR __Days = ([Value].[Date] - __BaseDate) * 1.
RETURN
  INT(__Days/20) + 1

 

Attached PBIX. 


@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors