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,
I am trying to convert date into week suchway: Week number (fisrt day of that week - last day of that week)
Example: "Week-21 (20 May -26 May)"
. I was able to extract week number "Week-21" but then adding the date of that week with Week number is unable to do. The week starts from Monday-Sunday.
Solved! Go to Solution.
Hi @logan_logan ,
I create a table as you mentioned.
Then I create a calculated column and here is the DAX code.
Week Description =
VAR WeekNumber =
"Week-" & WEEKNUM ( [Date], 2 )
VAR WeekStart =
[Date] - WEEKDAY ( [Date], 2 ) + 1
VAR WeekEnd = WeekStart + 6
RETURN
WeekNumber & " ("
& FORMAT ( WeekStart, "dd MMM" ) & " - "
& FORMAT ( WeekEnd, "dd MMM" ) & ")"
Finally you will get what you want.
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @logan_logan ,
I create a table as you mentioned.
Then I create a calculated column and here is the DAX code.
Week Description =
VAR WeekNumber =
"Week-" & WEEKNUM ( [Date], 2 )
VAR WeekStart =
[Date] - WEEKDAY ( [Date], 2 ) + 1
VAR WeekEnd = WeekStart + 6
RETURN
WeekNumber & " ("
& FORMAT ( WeekStart, "dd MMM" ) & " - "
& FORMAT ( WeekEnd, "dd MMM" ) & ")"
Finally you will get what you want.
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @logan_logan
please try below dax :
Week Range =
VAR StartOfWeek = STARTOFWEEK('YourDateColumn', 2)
VAR EndOfWeek = StartOfWeek + 6
RETURN
"Week-" & FORMAT(StartOfWeek, "ww") & " (" & FORMAT(StartOfWeek, "dd MMM") & " - " & FORMAT(EndOfWeek, "dd MMM") & ")"
Learn Power BI free:
https://analyticpulse.blogspot.com
can you please recheck this part?
VAR StartOfWeek = STARTOFWEEK('YourDateColumn', 2)
there is no such function like STARTOFWEEK
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 14 | |
| 5 | |
| 5 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 10 | |
| 10 | |
| 6 | |
| 6 |