Forum Discussion

ryan_b_fiting's avatar
ryan_b_fiting
Icon for Post Patron rankPost Patron
5 years ago
Solved

Date Groupings - 4 Week Increments

Hello Community -  I have weekly data that has a report date for each week ending date.  I want to create groupings so that I can have the values aggregated into 4 week buckets.  I have provided a s...
  • v-kelly-msft's avatar
    5 years ago

    Hi  ryan_b_fiting ,

     

    First go to query editor >create an index column;

    Then create 2 columns as below:

    rankx = RANKX(FILTER('Table',MOD('Table'[Index],4)=0),'Table'[Index],,ASC)
    4 Wk Ended = 
    var _mindate=CALCULATE(MIN('Table'[Time]),FILTER('Table','Table'[rankx]=EARLIER('Table'[rankx])))
    Return
    _mindate+21

    And you will see:

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!