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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors