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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
KMcCarthy9
Helper V
Helper V

Week Number Showing Twice

Hello, I have a stacked column graph that I want the X axis to show the values by month/year and then drill down into week number. The visual I created does this but at times shows the same week number twice - when the 1st day of the month is in the middle of the week.  In my sample this happens at the end of April 2020, and beginning of May 2020, as well as a few other places. 

I created DAX that fixes the week number issue, however when I use it I am unable to show the values by month/year...it only shows them by month with values from both years aggrated into one month column for a specific month (ie, Feb 2019 and Feb 2020, are only showing as Feb). 

I want to be able to see values by year/month and then drill down to the week numbers but only have a week number showing once. 

 

I have included a sample .pbix file here: .pbix file 

Thank you! 

DAX that fixes week issue


eeknostr = 
FORMAT (
    YEAR ( Datetable[Date] - ( WEEKDAY ( Datetable[Date], 2 ) - 2 ) ),
    "0000")

& "-"
     & SWITCH (
        MONTH ( Datetable[Date] - ( WEEKDAY ( Datetable[Date], 2 )-2 ) ),
        1, "Jan-",
        2, "Feb-",
        3, "Mar-",
        4, "Apr-",
        5, "May-",
        6, "Jun-",
        7, "Jul-",
        8, "Aug-",
        9, "Sep-",
        10, "Oct-",
        11, "Nov-",
        12, "Dec-"
    )
    & FORMAT (
        WEEKNUM ( Datetable[Date] - ( WEEKDAY ( Datetable[Date], 2 ) - 2 ),1 ),
        "00"
    )

 

1 ACCEPTED SOLUTION
KMcCarthy9
Helper V
Helper V

I was able to solve this by creating this measure and just using the date hierarchy of it, instead of separately bringing in a month and week column. 

Week Start Date = DateTable[Date] - WEEKDAY(DateTable[Date],2) + 1

 

View solution in original post

3 REPLIES 3
KMcCarthy9
Helper V
Helper V

I was able to solve this by creating this measure and just using the date hierarchy of it, instead of separately bringing in a month and week column. 

Week Start Date = DateTable[Date] - WEEKDAY(DateTable[Date],2) + 1

 

amitchandak
Super User
Super User

@KMcCarthy9 , No access to file. I think this is because when expand show both month and week. Week split across month and it is shown twice.

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

@amitchandak Sorry about that. Try this file: .pbix file.

Is there a way to stop it from showing both the month and week number on drill down?

 

Thanks!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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