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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cheid_4838
Helper I
Helper I

How to Exclude the last week when a

Spoiler
 The slicer I created selects data from the last 13 weeks and then shows the week start date for those periods in the table below.  The last week of the 13 week period is not visible because there is no data for this particular customer.  I would like the last week to be excluded because it's being it's skewing the average by treating last week as a "0" and skewing some other numbers due to the limited amount of available data.  I tried a couple of different formulas with no luck.  I also tried modifiying the formula below that I created to calculate the week start date.  Can this be modified at all to exclude the last week of the 13 week period? Thanks.

WEEK START DATE = ('Delivery Dates'[Date]-weekday('Delivery Dates'[Date])+1)

cheid_4838_2-1709050402975.png

 



 



cheid_4838_0-1709050212615.png

 

 

2 REPLIES 2
cheid_4838
Helper I
Helper I

Thanks for taking the time to respond to my problem. When I used your formula nothing changed with my results. I am not sure if it has to do with how my dashboard is modeled.  

v-yilong-msft
Community Support
Community Support

Hi @cheid_4838 ,

To exclude the last week of the 13-week period, you can modify your formula for calculating the week start date. Let’s adjust it to exclude the week that corresponds to the most recent data point.

You can change your DAX codes for another try.

WEEK START DATE = 
IF (
    'Delivery Dates'[Date] < MAX('Delivery Dates'[Date]) - 7,
    'Delivery Dates'[Date] - WEEKDAY('Delivery Dates'[Date]) + 1,
    BLANK()
)

 

 

 

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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