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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ThomasBP
Frequent Visitor

problem_New_year_calculs_refresh

Hello, 

 

 

I was wondering, in one of my calcul for the current week I put: Semaine_en_cours = WEEKNUM(TODAY())

So since 2018, I have all the current weeks auto calculated. 

 

For today, the formula includes the 31/12/2018 as the "53rd" week . But 2018 ends at the "52" (see bellow)
So How may I get my " Semaine en cours : 1 " on the board ? 

 

 update_dates.PNG

 

 

 

Any solutions /advice / tips ? 

Thanks by advance,

 

4 REPLIES 4
themistoklis
Community Champion
Community Champion

@ThomasBP

 

Also there is another parameter for the weeknum function where you specify whether a week starts on Sunday or on Monday.

v-juanli-msft
Community Support
Community Support

Hi @ThomasBP

try this measure instead of your formula

you could replace "DATE( )" with today( )

Measure 2 = var week1=WEEKNUM(DATE(2018,12,31),2) return IF(week1>52,1,week1)

11.png

 

Best Regards

Maggie

v-juanli-msft
Community Support
Community Support

Hi @ThomasBP

if you want the slicer to change as you said, 

please create calculated columns in your date table

slicer-weeknum = IF([calendar_weeknum]>52,1,[calendar_weeknum])
slicer-year = IF([calendar_weeknum]>52,[calendar_year]+1,[calendar_year])

 

 

10.png

11.png

 

Best regards

Maggie

Greg_Deckler
Community Champion
Community Champion

Well, the issue is that there really are 53 weeks in 2018. But, if it bugs you, you can always do this:

 

Semaine_en_cours = 
VAR __weeknum1 = WEEKNUM(TODAY())
RETURN
IF(__weeknum1 > 52,52,__weeknum1) 


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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
Top Kudoed Authors