Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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.

 

  • I'm thinking:

     

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

     

    Attached PBIX. 

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    I'm thinking:

     

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

     

    Attached PBIX. 

    • Rabi's avatar
      Rabi
      Icon for Resolver I rankResolver I

      Greg_Deckler , absolute genius, but instead of the number how can i get actual date of the fortnight