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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
prabhuk
Helper I
Helper I

Week Number to Date range

Hello,

Is there any solution to have date range for week number in calender table. Example Week 1 represent first 5 days of the month than, date range column show 01-05.

I have attached sample BPI file for you reference. Kindly help solve this.

https://www.dropbox.com/s/i1tgbulqeq00nl7/PBI%20File.pbix?dl=0 

 

Prabhu

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @prabhuk 

 

I'd like to suggest you create a calculated column as below. The pbix file is attached in the end.

Year-Month-Week-Day = 
var year = YEAR([Date])
var month = FORMAT([Date],"mmm")
var weeknum = WEEKNUM([Date],2)
var _min = 
MINX(
    FILTER(
        CALENDAR(MIN('Time'[Date]),MAX('Time'[Date])),
        YEAR([Date])=year&&
        FORMAT([Date],"mmm")=month&&
        WEEKNUM([Date],2)=weeknum
    ),
    [Date]
)
var _max = 
MAXX(
    FILTER(
        CALENDAR(MIN('Time'[Date]),MAX('Time'[Date])),
        YEAR([Date])=year&&
        FORMAT([Date],"mmm")=month&&
        WEEKNUM([Date],2)=weeknum
    ),
    [Date]
)
return
year&"-"&month&"-"&"WeekNum:"&weeknum&"-"&DAY(_min)&"-"&DAY(_max)

 

Result:

d2.pngd3.png

 

Best Regards

Allan

 

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

View solution in original post

1 REPLY 1
v-alq-msft
Community Support
Community Support

Hi, @prabhuk 

 

I'd like to suggest you create a calculated column as below. The pbix file is attached in the end.

Year-Month-Week-Day = 
var year = YEAR([Date])
var month = FORMAT([Date],"mmm")
var weeknum = WEEKNUM([Date],2)
var _min = 
MINX(
    FILTER(
        CALENDAR(MIN('Time'[Date]),MAX('Time'[Date])),
        YEAR([Date])=year&&
        FORMAT([Date],"mmm")=month&&
        WEEKNUM([Date],2)=weeknum
    ),
    [Date]
)
var _max = 
MAXX(
    FILTER(
        CALENDAR(MIN('Time'[Date]),MAX('Time'[Date])),
        YEAR([Date])=year&&
        FORMAT([Date],"mmm")=month&&
        WEEKNUM([Date],2)=weeknum
    ),
    [Date]
)
return
year&"-"&month&"-"&"WeekNum:"&weeknum&"-"&DAY(_min)&"-"&DAY(_max)

 

Result:

d2.pngd3.png

 

Best Regards

Allan

 

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

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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