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
mithiladas02
Helper I
Helper I

Colum Header time period matrix

My matrix table in power bi is just like that. Every tuesday i have to refresh the dataset. the weekday is saturday to friday. how do i update my date when i update the data automatically in column header? For expample, on 8/31(tuesday) when i refresh the dataset in my column header it will show for prior week on 8/21, Trans in-/21 to 8/27,  Current week- 8/27.

 

GroupPrior week  on 8/14Trans in 8/14 to 8/20Trans out 8/14 to 8/20Current week 8/20
a1102
b2002
c3003
3 REPLIES 3
V-lianl-msft
Community Support
Community Support

Would it be useful to apply a relative date filter in a visual level filter?

If the problem persists, please remove the sensitive data and share a sample pbix.

https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-... 

mithiladas02
Helper I
Helper I

thanks for you reply. 

 

I wrote the sytex as below

var pw= 'Date'[Date]+-1*if(WEEKDAY('Date'[Date])<7,WEEKDAY('Date'[Date]),WEEKDAY('Date'[Date])-7)

VAR PWNAME='Date'[Date]+-1*if(WEEKDAY('Date'[Date])<7,WEEKDAY('Date'[Date]),WEEKDAY('Date'[Date])-7),"MM/DD")

var transin=[Start date] & " to "& [ End date]

VAR TRANSINNAME=[Week Start date] & " to "& [Week End date],"mm/dd"

var cw='Date'[Week Start date(Sat-Fri)]+6

var cwname='Date'[Week Start date(Sat-Fri)]+6,"mm/dd

var result=
pw,"prior week"& "(" & pwname & ")",
cw,"current week" & "(" & cwname & ")",
transin, "transin" & "(" transinname & ")"
)

return result

 

 

 

but it is showing me the -"switch function  does not support comparing value of types true/ false with value of type Data , Consider using the value or format function to convert one of the values.

 

what i am doing wrong? will you please help me?

 

 

amitchandak
Super User
Super User

@mithiladas02 , For Saturday week you can get

2.Any Weekday Week - Start From Any day of Week
https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Powe...

 

Using the start Week snd end week create

 

Week Type = Switch( True(),
[start week]<=Today() && [end date]>=Today(),"Current Week" & format([start week], "mm/dd") ,
[start week]<=Today()-7 && [end date]>=Today()-7,"Last Week" & format([start week], "mm/dd") ,
[Week Name]
)

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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