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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Dayna
Helper V
Helper V

Current weeknumber showing incorrectly (i.e. next week)

Hello,

 

I have a very simple measure to get the current week number, as below:

Today (Week) = FORMAT(TODAY(), "YYYY/WW")
 
Today, being May 19th, belongs to week 20 in the calendar. However, this measure returns 2022-21.
Does anyone have any ideas why this is the case or how I can change it so it accurately reflects the current week, please?
 
Many thanks,
Dayna
2 ACCEPTED SOLUTIONS
ribisht17
Super User
Super User

@Dayna 

You have a point here,

 

ribisht17_0-1652970129146.png

 

This is taking the 1st of Jan as the first week, 

So, I need to go back by 1 week with the below probably 🙂

Today (Week) = FORMAT(TODAY()-7, "YYYY/WW")
 
ribisht17_1-1652970216556.png

 

 
Regards,
Ritesh

View solution in original post

Samarth_18
Community Champion
Community Champion

Hi @Dayna , Its calculating week number based on ISO 8601.

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

5 REPLIES 5
Dayna
Helper V
Helper V

Thank you all!

Samarth_18
Community Champion
Community Champion

Hi @Dayna ,

 

Please try this:-

 

Today (Week) = FORMAT(TODAY(), "YYYY/"&weeknum(today(),21))

Output:-

Samarth_18_0-1652970189475.png

 

 

 

BR,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Hi @Samarth_18 that works, but can you explain what the ,21 is doing, please?

Samarth_18
Community Champion
Community Champion

Hi @Dayna , Its calculating week number based on ISO 8601.

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

ribisht17
Super User
Super User

@Dayna 

You have a point here,

 

ribisht17_0-1652970129146.png

 

This is taking the 1st of Jan as the first week, 

So, I need to go back by 1 week with the below probably 🙂

Today (Week) = FORMAT(TODAY()-7, "YYYY/WW")
 
ribisht17_1-1652970216556.png

 

 
Regards,
Ritesh

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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