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
cheid_4838
Helper IV
Helper IV

How to calculate rolling 13 weeks?

I would like to list in a matrix table the week start date for the previous 13 weeks and have that update based on current date.  I don't want to have to select these dates manually using a slicer. Is there anyway to get these to list and then update based on current date?  Thanks for your help.

 

cheid_4838_1-1706817095121.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @cheid_4838 

 

My sample:

vxuxinyimsft_0-1706857034688.png

 

You can create a measure as follows.

Measure = 
VAR _1 = TODAY() -91
VAR _2 = WEEKDAY(_1, 2)
VAR _3 = _1 - _2 + 1
RETURN
IF(SELECTEDVALUE('Table'[Date]) >= _3 && SELECTEDVALUE('Table'[Date]) <= TODAY(), 1, 0)

 

Put the measure into the visual-level filters, set up show items when the value is 1.

vxuxinyimsft_1-1706857103370.png

Is this the result you expect?

 

Best Regards,
Community Support Team _Yuliax

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @cheid_4838 

 

My sample:

vxuxinyimsft_0-1706857034688.png

 

You can create a measure as follows.

Measure = 
VAR _1 = TODAY() -91
VAR _2 = WEEKDAY(_1, 2)
VAR _3 = _1 - _2 + 1
RETURN
IF(SELECTEDVALUE('Table'[Date]) >= _3 && SELECTEDVALUE('Table'[Date]) <= TODAY(), 1, 0)

 

Put the measure into the visual-level filters, set up show items when the value is 1.

vxuxinyimsft_1-1706857103370.png

Is this the result you expect?

 

Best Regards,
Community Support Team _Yuliax

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Community Champion
Community Champion

@cheid_4838 You could create a DAX calculated table for this, or a Power Query query that calculates this. Something along the lines of:

Table 2 = GENERATESERIES( TODAY() - 13*7, TODAY(), 7)


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...

Thanks Greg for the support.  When I try your logic I get the below error message when I use it to create a new column. When I create a measure it won't allow me to put it in as a column or row. 

cheid_4838_0-1706904472027.png

 

Community Support Team _Yuliax,

I tried your logic and for some reason I get "0" as the result.  Could that be a result of a problem with the date file that I use?

 

Is there logic that can be put in a columN? 

 

 

Thanks again for the support and your help on this issue.

@cheid_4838 Did you create a calculated table or did you try that in a calculated column or measure?



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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors