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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Slicer updating custom made week by the current week

Hi, I have a report which is showing weekly stats based on a custom made week. In our company the weeks goes from Friday to Thursday. 
I have a custom made week column which looks like this:

Week+Dates = 'Date'[Week of Year(Fri-Thu)!] &": (" & 'Date'[WeekBetweenDates] &")"
I.E for this current week its week 12 and goes from 18th of march until 24th of march. Appears like this: 12: (18.03 - 24.03)
Im using this logic in a slicer and it works great.

To my issue:
Tomorrow it will be a new week: 13: (25.03 - 31.03) and I want my report to change to this automaticly when entering the report, so I dont have to select this manually each week.

Is this something that can be solved?

Appriciate any help! 
Thank you.



13 REPLIES 13
Whitewater100
Solution Sage
Solution Sage

Hi:

I beleive you may already have a way for week to begin on Friday. Just in case, this is less code:

Week Start Fri = WEEKNUM(TableName[Date],15)
 
For the current week slicer the below noramlly works 
 

You can put a calculated column in your fact table and use it as the slicer. But first add WeekNum to your fact table. You can do that in PQ or in DAX. 

 

Current Week in Fact Table = IF(FactTable[WeekNum] = MAX(FactTable[WeekNum]), "Current", CONVERT(FactTable[WeekNum], STRING))

 

Current Week in Date Table CC = 

Curr Week =

var cweek = WEEKNUM(TODAY())

return

IF(Dates[Week No.] =cweek,

"Current", CONVERT(Dates[Week No.],STRING))

Use this for your slicer and select current week from filter pane and it will always open to current week.

 

 

I believe this will also work if you put this Current Week Calc Col in the Dates Table and follow the same steps.

Anonymous
Not applicable

@Whitewater100 Hi, thanks. Im not able to make this work, I get the same outcome as last time. Could you please show in the file that I shared?

Hi:

OK, I will try that. I will look asap, after some meetings today. Hope that is OK. Thanks

Anonymous
Not applicable

@Anonymous Hi see this link to the test report
https://drive.google.com/file/d/1a1CikvXnR3nnWl-pWlLhsIZOEYZWv8-o/view?usp=sharinghttps://drive.google.com/file/d/1a1CikvXnR3nnWl-pWlLhsIZOEYZWv8-o/view?usp=sharing

My desired outcome is that the report will move automaticly to Week no 14 when first of april starts:

Kiisj_0-1648544083084.png

 




Hi Kiisj:

You did an awesome job making the calendar. I just subtracted a 1 to get current week. I have put that as a filter in the filter panel. The other thing is I disconnected the auto date time as there were several date tables running in  the background. I wasn't sure if you wanted to change the first date to 12-30-2021 or leave it, so I left it.

I hope this was helpful as you did most all the work!  Thanks..

https://drive.google.com/file/d/16X0PLjZClrQSZlgNEdVfGVfj53YQbXPr/view?usp=sharing 

Anonymous
Not applicable

Hi @Anonymous ,

Because the values of table column is always fixed, they won't be automatically changed everyday. Also, we are not able to add measures into a slicer.

 

To work around your requirement, you could create two measures and a calendar table as below:

Week start = TODAY()-WEEKDAY(TODAY(),2)+1
Week End = TODAY()-WEEKDAY(TODAY(),2)+7
Date Table = CALENDAR([Week start],[Week End])

Add 'Date Table'[Date] into slicer.

vpollymsft_0-1648520609963.png

Then create relationship between the tables.

vpollymsft_1-1648520646687.png

vpollymsft_2-1648520725337.png

If I have misunderstood your meaning, please provide your pbix file without privacy information and desired output.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

@Whitewater100 hi, I dont understand how this will solve my issue with updating the slicer to the current week automaticly?
I already have the custom weeks in my report in a slicer:

Kiisj_0-1648194489036.png


The problem is how this can be 13: (25.03 - 31.03) without touching it 🙂

Hi:

Sorry I misunderstood. You can put a calculated column in your fact table and use it as the slicer. But first add WeekNum to your fact table. You can do that in PQ or in DAX. 

 

Current Week in Fact Table = IF(FactTable[WeekNum] = MAX(FactTable[WeekNum]), "Current", CONVERT(FactTable[WeekNum], STRING))

 

Current Week in Date Table CC = 

Curr Week =
var cweek = WEEKNUM(TODAY())
return
IF(Dates[Week No.] =cweek,
"Current", CONVERT(Dates[Week No.],STRING))

Use this for your slicer and select current week from filter pane and it will always open to current week.

Whitewater100_0-1648212743138.png

 

 

I beleive this will also work if you put this Current Week Calc Col in the Dates Table and follow the same steps.

 

If you'd like, if you share some sample data I can show this technique.

 

Thanks..

Anonymous
Not applicable

Hi, thank you @Whitewater100 ,
The problem with the column now is that it shows the next week as "current":

Kiisj_0-1648494994364.png

 

The formula looks like this:

Current week =
var cweek = WEEKNUM(TODAY())
return
IF('Date'[Week of Year(Fri-Thu)!] = cweek,
"current",CONVERT('Date'[Week of Year(Fri-Thu)!],STRING))

Where ('Date'[Week of Year(Fri-Thu)!] is the modified week number (format in Whole numbers).

Any idéas?

I would love to share a sample in pbix but im not sure how to post it here. 





Hi Kiisj:

It might be something about your date table.

This usually is an easy fix..

If you go to Google Drive and where it says MY Files, you can choose Upload. 

 

On the right side the menu has "Recents". You can Rclick on your file and it will ask if you want a link to share.  Sometimes on the dropdown you choose "anyone with this link" to allow others to see. Of course if it's not private.

 

I hope this helps!

Anonymous
Not applicable
Whitewater100
Solution Sage
Solution Sage

I beleive these columns would work ( to produce results against data)only if they are in your fact table.  I just tested. on a different week start. The calculated columns initially given for Fri-Tursday would work for your purpose.

Whitewater100_0-1648149328824.png

 

Whitewater100
Solution Sage
Solution Sage

Hi:

You can have two calculated columns, I put thrm in Date Table.

Week Start (Fri) = Dates[Date] - WEEKDAY(Dates[Date],2)+5
Week End (thur) = Dates[Date] - WEEKDAY(Dates[Date],2)+11
 and then you can have slicer. Please see below..
Whitewater100_1-1648148034513.png

 

Whitewater100_0-1648147966299.png

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.