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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
marenecaCZ
Frequent Visitor

Use measure in filter pane

Hello,

I created matrix visual like this:

marenecaCZ_0-1681978574658.png

Weeks are in columns.

I would like to display only last 4 weeks without last week. In my case it is week5 till week8 (=4 weeks). Only these 4 weeks I would like to have in visual.

In "Filters on this visual" I can do it this way:

 

marenecaCZ_2-1681978785757.png

But new data column will be added every week. After 5 more weeks I will have weeks (columns) in matrix from 1 to 14. But I still need to display last 4 weeks without the last week (= from week10 till week13). I don't want to change the "Filters on this visual" every week.

Can I set the filter somehow automatically?

 

I create new mesure for the maximum week = weeknum(today()) -1
I create new mesure for the minimum week = weeknum(today()) -4

But it's not posible to use this measures instead of numbers in "Filters on this visual".

 

Thank you

 

 

 

1 REPLY 1
krishb1414
Helper III
Helper III

Hi @marenecaCZ  
=> Firstly create one new table with this code 

         SUMMARIZE(dim_Date,dim_Date[Weeknum],"max date",FORMAT( MAX(dim_Date[Date]),"dd-mmm-yy" ))
=> Next use lookup function in main table to get max date from table (with above code)
    week =   LOOKUPVALUE('Summarize'[max date1],'Summarize'[Weeknum],'dim_Date'[Weeknum])
=> then make this format as date 
=> finally use this week in filter pane and put filter as last 4 weeks.
Then in future also it will dynamically filter only 4 weeks, if you want you can chnage 6 weeks, 8 weeks......
See the image below
krishb1414_0-1681980485000.png

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors