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
rdini8
Helper I
Helper I

Week Number of a Particular Date Range

Hi everyone, I am currently working on a report which has a date range slicer. I want to be able to have another slicer/filter of week number based on the current date range. For example, if the date range is from 1st August to 2nd September, the first 7 days from 1st August would be week 1, then the next 7 days would be week 2 and so forth, till the end of the date range. 

8 REPLIES 8
Ahmedx
Super User
Super User

look at this solution

Ahmedx
Super User
Super User

pls try this

Screenshot_1.png

The Dax just gives me a static number when used as a calculated column expression

you can't create a calculated column based on a slice, power bi doesn't support that

I created a measure

I require to use this is on another slicer and a measure can't be used

 

unfortunately power bi doesn't support this

PijushRoy
Super User
Super User

Hi @rdini8 

Please use below DAX

 

WeekNumber = 
VAR StartDate = MIN('YourTable'[Date])
VAR CurrentDate = 'YourTable'[Date]
VAR WeekStartDate = STARTOFWEEK(StartDate, 1)
RETURN
    CEILING((CurrentDate - WeekStartDate) / 7, 1)

 


If your requirement is solved, please make sure to MARK AS SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.

Thanks
Pijush
Linkedin




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Hi @PijushRoy  STARTOFWEEK function doesn't exist

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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