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
Niraj_vora0106
Helper III
Helper III

Week Start calculation

Hi community, 

 

I want to group dates between Week_Start and Week_End.

Yes I tried using WEEKDAY() function but I want it to be Dynamic. 

 

For eg: 

The current week in India, if I take Monday as starting is from 4th July - 10th July 2022.

 

So after 10th July as the date changes to 11th July, and so will the week.

I want the week to change dynamically ie : from 11th July - 17th July 2022.

 

Is there any way we can do this?

 

Please Help!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Niraj_vora0106 , You can get week start and week end like

 

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)

 

 

week name = format( 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1 , "dd \t\h mmmm - ") &
 format( 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2), "dd \t\h mmmm yyyy") 

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Niraj_vora0106 ,

Please refer to my pbix file to see if it helps you.

Create two columns.

weekday = WEEKDAY('Table'[Date],2)
weeknum = WEEKNUM('Table'[Date],2)

Then create a measure.

Measure =
VAR _startday =
    WEEKDAY ( TODAY (), 2 )
VAR _startweeknum =
    WEEKNUM ( TODAY (), 2 )
RETURN
    IF (
        MAX ( 'Table'[weeknum] ) = _startweeknum
            && MAX ( 'Table'[weekday] ) >= 1,
        MAX ( 'Table'[Date] ),
        IF (
            MAX ( 'Table'[weeknum] ) = _startweeknum
                && MAX ( 'Table'[weekday] ) <= 7,
            MAX ( 'Table'[Date] ),
            BLANK ()
        )
    )

vpollymsft_0-1657164362153.png

 

 If I have misunderstood your meaning, please provide more details with your desired output.

 

Best Regards

Community Support Team _ Polly

 

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

Niraj_vora0106
Helper III
Helper III

Will it be dynamic? @amitchandak 

amitchandak
Super User
Super User

@Niraj_vora0106 , You can get week start and week end like

 

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)

 

 

week name = format( 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1 , "dd \t\h mmmm - ") &
 format( 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2), "dd \t\h mmmm yyyy") 

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.