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
Anonymous
Not applicable

set a date filter dynamiclly on a Power BI report page : show the data for the last 13 weeks

Hello dear community; I hope you are doing well 😀

 

I have a power BI report that is using a Live connection on a tabular model.

 

I have created a power bi report page that must display data only for the last 13 weeks.

 

my data model doesn't contain a date table; it only consists on a one big table that conatains all the necessary fields including date fields ( Year, Semester, Month and Week) and there is no day field ( I dont have the possibility to bring it in my data model)

 

I created the following  calculated column ( flag)  that I put it in a slicer :

last 13 weeks= IF ( '360ST'[YearWeek] >= MAX ('360ST'[YearWeek]) - 13 , "1", "0")

the flag doesn't work. I  note that the format of Week field is YYYYWW

 

I appreciate any help please, thanks

1 REPLY 1
Payeras_BI
Solution Sage
Solution Sage

Hi @Anonymous ,

 

You say you have Year and Week in separate date fields, I would create a calculated column with the Start Date of the Week and, then, use it to calculate the difference in weeks from its max value. From there you can move on filtering your report based on this value making sure it works when changing the year (from 2020 to 2021).

 

Payeras_BI_0-1610452573798.png

Payeras_BI_1-1610452875628.png

 

ISO Start of week formula thanks to @wgarn 

 

Regards,

 

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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