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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi All,
I need Assistence on this
I have Date column, in that i need to present weeks as
May 1 to 7
May 8 to 14
May 15 to 21
May 22 to 28
May 29 to June 4 Like this
Thank you for in Advance.
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
It is for creating a calendar table like below.
New calendar table =
VAR _t =
ADDCOLUMNS (
CALENDAR ( DATE ( 2023, 1, 1 ), DATE ( 2023, 12, 31 ) ),
"Year-Week",
IF (
MONTH ( [Date] ) = 1
&& WEEKNUM ( [Date], 21 ) > 50,
YEAR ( [Date] ) - 1 & "-"
& WEEKNUM ( [Date], 21 ),
YEAR ( [Date] ) & "-"
& WEEKNUM ( [Date], 21 )
)
)
VAR _weekcolumn =
ADDCOLUMNS (
_t,
"weekcolumn",
IF (
MONTH ( MINX ( FILTER ( _t, [Year-Week] = EARLIER ( [Year-Week] ) ), [Date] ) )
= MONTH ( MAXX ( FILTER ( _t, [Year-Week] = EARLIER ( [Year-Week] ) ), [Date] ) ),
FORMAT (
MINX ( FILTER ( _t, [Year-Week] = EARLIER ( [Year-Week] ) ), [Date] ),
"mmm-dd"
) & " to "
& FORMAT (
MAXX ( FILTER ( _t, [Year-Week] = EARLIER ( [Year-Week] ) ), [Date] ),
"dd"
),
FORMAT (
MINX ( FILTER ( _t, [Year-Week] = EARLIER ( [Year-Week] ) ), [Date] ),
"mmm-dd"
) & " to "
& FORMAT (
MAXX ( FILTER ( _t, [Year-Week] = EARLIER ( [Year-Week] ) ), [Date] ),
"mmm-dd"
)
)
)
RETURN
_weekcolumn
Hi,
Thank you for your message, if you already have a date column, and if your expected outcome is to create an additinal column in the same table, please check the below picture and the attached pbix file.
Thank you.
WeekColumn CC =
VAR _t =
ADDCOLUMNS (
'Calendar',
"Year-Week",
IF (
MONTH ( [Date] ) = 1
&& WEEKNUM ( [Date], 21 ) > 50,
YEAR ( [Date] ) - 1 & "-"
& WEEKNUM ( [Date], 21 ),
YEAR ( [Date] ) & "-"
& WEEKNUM ( [Date], 21 )
)
)
VAR _weekcolumn =
ADDCOLUMNS (
_t,
"weekcolumn",
IF (
MONTH ( MINX ( FILTER ( _t, [Year-Week] = EARLIER ( [Year-Week] ) ), [Date] ) )
= MONTH ( MAXX ( FILTER ( _t, [Year-Week] = EARLIER ( [Year-Week] ) ), [Date] ) ),
FORMAT (
MINX ( FILTER ( _t, [Year-Week] = EARLIER ( [Year-Week] ) ), [Date] ),
"mmm-dd"
) & " to "
& FORMAT (
MAXX ( FILTER ( _t, [Year-Week] = EARLIER ( [Year-Week] ) ), [Date] ),
"dd"
),
FORMAT (
MINX ( FILTER ( _t, [Year-Week] = EARLIER ( [Year-Week] ) ), [Date] ),
"mmm-dd"
) & " to "
& FORMAT (
MAXX ( FILTER ( _t, [Year-Week] = EARLIER ( [Year-Week] ) ), [Date] ),
"mmm-dd"
)
)
)
RETURN
SUMMARIZE (
FILTER ( _weekcolumn, 'Calendar'[Date] = EARLIER ( 'Calendar'[Date] ) ),
[weekcolumn]
)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 58 | |
| 45 | |
| 42 | |
| 21 | |
| 18 |