Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I have all weeks data in column chart but in that only latest four weeks to be shown automatically not selecting the filter/slicer below is the shown image.
In this i want see wk 28,27,26,25 and if week changes then the current week and last 3 weels data should be seen autmatically
Regards
Atharva
Solved! Go to Solution.
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
WINDOW function (DAX) - DAX | Microsoft Learn
Sales latest 4 weeks: =
VAR _t =
WINDOW (
1,
ABS,
4,
ABS,
ALL ( 'calendar'[Year Week], 'calendar'[Start of Week] ),
ORDERBY ( 'calendar'[Start of Week], DESC )
)
RETURN
CALCULATE ( SUM ( sales[sales] ), KEEPFILTERS ( _t ) )
Hi @hb0135
Can you please try this to get your last week result.
Add visual level filter.
Drag Date column to the visual level filter and then in filter type set Relative date and as shown in the snapshot.
If this answers your questions, kindly accept it as a solution and give kudos.
Hi @hb0135
Is that automatic based on the latest week or based on slicer selection? Also, what if the last four weeks are from two different years?
Please provide a workable sample data (not an image), your expected result from the same sample data and your reasoning behind. You may post a link to Excel or a sanitized copy of your PBIX stored in the cloud.
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
WINDOW function (DAX) - DAX | Microsoft Learn
Sales latest 4 weeks: =
VAR _t =
WINDOW (
1,
ABS,
4,
ABS,
ALL ( 'calendar'[Year Week], 'calendar'[Start of Week] ),
ORDERBY ( 'calendar'[Start of Week], DESC )
)
RETURN
CALCULATE ( SUM ( sales[sales] ), KEEPFILTERS ( _t ) )
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 58 | |
| 45 | |
| 41 | |
| 21 | |
| 18 |