Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
snamhoang
New Member

[Need Help] Create Filter to Display the last 5 weeks

Hi guys,

I have the data with the period of the last 10 weeks' performance.

However, I only wanna display the last 5 weeks' by creating a filter with the script as in the photo.

Yet it shows some errors. Any suggestion for this?
Thanks!

 

Capture.PNG

Capture2.PNG

1 ACCEPTED SOLUTION
v-huizhn-msft
Employee
Employee

Hi @snamhoang,

Your formula shows some errors, because you create a measure rather than calculated column. You should create a calculated column which will used to filter your report as @Phil_Seamark posted.

Best Regards,
Angelia


View solution in original post

2 REPLIES 2
v-huizhn-msft
Employee
Employee

Hi @snamhoang,

Your formula shows some errors, because you create a measure rather than calculated column. You should create a calculated column which will used to filter your report as @Phil_Seamark posted.

Best Regards,
Angelia


Phil_Seamark
Employee
Employee

Hi @snamhoang,

 

If you have a calendar/date table, you could add this column to it

 

Weeks From Today =  IFERROR( DATEDIFF('Dates'[Date],TODAY(),WEEK),-1)

Then you can include it in your Page, Report or Visual level filter to show where the value is >0 and < 5 

 

This gives you the flexibility to choose different ranges.


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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