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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

weekly date breakdown.

lamlamm24_0-1680721451493.png

 

 

5 REPLIES 5
v-shex-msft
Community Support
Community Support

HI @Anonymous,

You can try to create a calculated column with following formulas to show the current week ranges that include year start/end checkings:

Weekbreakdown =
VAR sWeek =
    [Date] - WEEKDAY ( [Date], 1 ) + 1
RETURN
    IF (
        WEEKNUM ( [Date], 1 ) <> 1
            && WEEKNUM ( [Date], 1 ) <> WEEKNUM ( DATE ( YEAR ( [Date] ), 12, 31 ), 1 ),
        sWeek & "-" & sWeek + 6,
        IF (
            WEEKNUM ( [Date], 1 ) = 1,
            DATE ( YEAR ( [Date] ), 1, 1 ) & "-" & sWeek + 6,
            sWeek & "-"
                & DATE ( YEAR ( [Date] ), 12, 31 )
        )
    )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

This is the DAX i used for week break down but its Blank. 

Week Date Range =
VAR StartDate = MIN('Date'[Date])
VAR EndDate = TODAY()
VAR Weeks = WEEKNUM(EndDate) - WEEKNUM(StartDate) + 1
RETURN
GENERATESERIES(
    StartDate - WEEKDAY(StartDate, 2) + 1,
    StartDate -WEEKDAY(StartDate, 2) + (Weeks * 7),
    7
)
Anonymous
Not applicable

I also tried this DAX

Wek Breakdown =
    FORMAT(DATEADD('Date'[Date], -WEEKDAY('Date'[Date], 1), DAY), "MM/dd")
    & " - " &
    FORMAT(DATEADD('Date'[Date], 7 - WEEKDAY('Date'[Date], 1), DAY), "MM/dd"). 
This sorts of gives me what i want but it is not including today's date.
If i try to include this week 04/01 -today's date, it shows me 12/29
vicky_
Super User
Super User

If you have a date calendar, then you can just drag both fields over to a table and it should show the dates between. Depending on the type of visual you are using (e.g. matrix), there may be an option to show the +/- buttons under formatting.

vicky__3-1680732459004.png

 

Anonymous
Not applicable

This is exactly what i want to see. But what DAX did you use for the WeekDateRange. 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.