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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Choose data, display current week data as well as previous week

Hi Guys,

 

based on a selected date (week) in a slicer (SlicerWeek), I want to display in a table the value of the week, as well as the previous week value.

 

The columns of the table contain the date, formatted as week.

There is a date table, linked to a fact table.

 

In the screenshot you can see the desired result of the table, but I want to select only one week in the Week Slicer and display tow weeks data (there are other visuals that show only the current week value).

PrevPeriod.PNG

 

Regards,

Toddy

 

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , Refer if my WOW blogs can help you

 

Power BI โ€” Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123
https://www.youtube.com/watch?v=pnAesWxYgJ8

 

or if want select one period and want to show more than that , then use independent date tbale

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

hey, @amitchandak 

Thanks for these very helpful links, but I'm still struggeling with the link to the chosen slicer / week. I'll try to have a dynamic previous week, not the previous week to the actual date

 

 

I have already a measures defined

z_Day_Worked_CW-1 = 
	CALCULATE(
		[z_Day_Worked],
		DATEADD('DIM_Calendar'[CAL_CalendarDay], -7, DAY)
	)

 

Maybe only the filtering is my problem...

 

 

@Anonymous , if you want to select a week, the above links can help. But if you want based on today

 

This Week today =
var _st = today() +-1*WEEKDAY(today(),2)+1 //monday week 
var _end =today()+ 7-1*WEEKDAY(today(),2)
return
CALCULATE(SUM(Sales[Sales Amount]),filter('Date','Date'[Date]>= _st && 'Date'[Date]<=_end )) //use all('Date') if need in filter


Last Week today =
var _st = today() +-1*WEEKDAY(today(),2)+1 -7  //monday week
var _end =today()+ 7-1*WEEKDAY(today(),2) -7
return
CALCULATE(SUM(Sales[Sales Amount]),filter('Date','Date'[Date]>= _st && 'Date'[Date]<=_end )) //use all('Date') if need in filter

 

 

sunday week

today() +-1*WEEKDAY(today(),1)+1

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Maybe I explained it wrong, maybe it's just a formatting issue.

 

Base data:

calendar table, with date, year, month, week, first day of week, week rank, ...

fact table, with date related, data to display in several categories

 

1. I want to choose one week in a week slicer

2. I want to display in tabular form the data of chosen week, as well as data from previous week, in total two weeks

PrevWeek_wish.PNG

All rows were calculated measures. All measures were defined for current period, as well as previous period, i.e. Holiday and Holiday_CW-1

 

The displayed table is a matrix visual, measures displayed in rows

In column heading is [Week_of_year]

PrevWeek_Measures.PNG

As you can see, when i'm adding cw-1 measure, it's shown in rows, not in columns and I wasn't able to display it in second column.

So my idea was to filter the week_of_year but also struggeling.

 

 

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric 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.

Users online (27)