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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Show Current Week by default

Hi everyone,
so im using current week filter and all weekNo. filter on left for year 2022,2021,2020 (same weeks)  so that boss can see chose which ever weeks he like.
Need:
but he wants the current week to be showed by default. so if he opens this report he will see the current week sales for the year 2022,2021 and 2020 (same week) and use the all weekNo. filter to see the other weeks other than current.

Saadii_360_0-1643658063586.png

Problem:

Problem is that the way i have used the current filter in dax does not  allow me to use the other all weeks filter. please find below the dax code i have used for current week

SemCourante =
//Current Weeks
if(year(now())&weeknum(now()-1) = year(DMVBICalendarView1[Date])&weeknum(DMVBICalendarView1[Date],1),"Courrante",
if((year(now()))-1&weeknum(now()) = year(DMVBICalendarView1[Date])&weeknum(DMVBICalendarView1[Date],1),"Courrante-1",
if((year(now()))-2&weeknum(now()) = year(DMVBICalendarView1[Date])&weeknum(DMVBICalendarView1[Date],1),"Courrante-2",
if((year(now()))-3&weeknum(now()) = year(DMVBICalendarView1[Date])&weeknum(DMVBICalendarView1[Date],1),"Courrante-3"))))
and please find below the weeknumbers,
Saadii_360_1-1643658595114.png

If any of you can solve this problem that will be a huge help. show me a way to merge weekno. and current week in the same code or column. so current week becomes default but if user selects any weekno. it shows the values as well.
thanks in advance to this wonderful community.

 

2 REPLIES 2
ValtteriN
Community Champion
Community Champion

Hi,

To use this logic all you need to do is to add the other  weeks as a selection to the IF logic. So something like this:

if(year(now())&weeknum(now()-1) = year(DMVBICalendarView1[Date])&weeknum(DMVBICalendarView1[Date],1),"Courrante",
if((year(now()))-1&weeknum(now()) = year(DMVBICalendarView1[Date])&weeknum(DMVBICalendarView1[Date],1),"Courrante-1",
if((year(now()))-2&weeknum(now()) = year(DMVBICalendarView1[Date])&weeknum(DMVBICalendarView1[Date],1),"Courrante-2",
if((year(now()))-3&weeknum(now()) = year(DMVBICalendarView1[Date])&weeknum(DMVBICalendarView1[Date],1),"Courrante-3",weeknum(DMVBICalendarView1[Date]))))
Alternatively you can use SWITCH + TRUE for a clearer syntax:

SWITCH(TRUE(),
year(now())&weeknum(now()-1) = year(DMVBICalendarView1[Date])&weeknum(DMVBICalendarView1[Date],1),"Courrante",
year(now()))-1&weeknum(now()) = year(DMVBICalendarView1[Date])&weeknum(DMVBICalendarView1[Date],1),"Courrante-1",
year(now()))-2&weeknum(now()) = year(DMVBICalendarView1[Date])&weeknum(DMVBICalendarView1[Date],1),"Courrante-2",
year(now()))-3&weeknum(now()) = year(DMVBICalendarView1[Date])&weeknum(DMVBICalendarView1[Date],1),"Courrante-3"
weeknum(DMVBICalendarView1[Date]))


I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/






Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

No. I just want current week by default. But when i click on other weeks it should not show blank values because of the current week filter.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.