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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Slicer to show Current Week by default

HI everyone. 
I want to show Current week as default when user open the report or changes the report page.

Saadii_360_0-1643922194040.png

I want this slicer to show by default whenever user opens the report or changes the report page. when user come backs to the page it should show the sales by current week.
PFB the dax im using currently to show the current week between the weeks,

Saadii_360_1-1643922295702.png

//Current Week Slicer
IF(DMVBICalendarView1[SemCourante]= "courrante", "Courante",
IF(DMVBICalendarView1[SemCourante]= "courrante-1", "Courante",
IF(DMVBICalendarView1[SemCourante]= "courrante-2", "Courante",
IF(DMVBICalendarView1[SemCourante]= "courrante-3", "Courante",
//Merging
DMVBICalendarView1[Semaine Fiscale] &"-"& DMVBICalendarView1[Semaine 2022]))))
Need your help. Thanks in advance.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

First you need to create a calculated column to return the week number and put the column in slicer to filter data .

week number=
var _number=WEEKNUM('Table'[Date])
var _today=WEEKNUM(TODAY())
return SWITCH(TRUE(),_number=_today,"Current",FORMAT(_number,"####"))

In the formula above , _number is the week number of each date , _today is the week number of today . When _number is equal to _today , you will get the dates belong to current week and return the value with text “current” .

Then create a measure to sum the value .

total value = SUM('Table'[Value])

The final result is as shown :

Ailsamsft_0-1644980806205.png

I have attached my pbix file , you can refer to it .

 

Best Regard

Community Support Team _ Ailsa Tao

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous 

First you need to create a calculated column to return the week number and put the column in slicer to filter data .

week number=
var _number=WEEKNUM('Table'[Date])
var _today=WEEKNUM(TODAY())
return SWITCH(TRUE(),_number=_today,"Current",FORMAT(_number,"####"))

In the formula above , _number is the week number of each date , _today is the week number of today . When _number is equal to _today , you will get the dates belong to current week and return the value with text “current” .

Then create a measure to sum the value .

total value = SUM('Table'[Value])

The final result is as shown :

Ailsamsft_0-1644980806205.png

I have attached my pbix file , you can refer to it .

 

Best Regard

Community Support Team _ Ailsa Tao

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

amitchandak
Super User
Super User

@Anonymous , the Issue is not clear.

 

But you need have start of week

 

start week = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1 //Monday
end date= 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)

 

Then you can create a new column like

 

Week Type = Switch( True(),
WEEKNUM("Datedim"[entrydate] ) = WEEKNUM( TODAY() ),"This Week" ,
WEEKNUM("Datedim"[entrydate] ) = WEEKNUM( TODAY() )-1,"Last Week" ,
[Week Name]
)

 

Create these in date table and save on this week. As of now you can not default it using a measure/funtion

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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