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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
samc_26
Helper IV
Helper IV

Add a set number of days to Max date

Hi, I'm struggling with adding a set number of days (an average from a measure) to a max date. Basically I have data like this: 

 

ProductDate 
Pencil08/07/25
Pencil15/08/25
Book01/04/25
Book23/05/25

 

What I need it to do is look at the max date and then add 5 days to each one. I can get the max date but every time I try to add a set number of days so it shows it on my report it goes wrong 😞

 

This is what I need it to do if I was going to add 5 days to each one:

 

ProductLatest Date Adding 5 days to latest date
Pencil15/08/2520/08/25
Book23/05/2528/05/25

 

If anyone can work this out for me that would be great! 

1 ACCEPTED SOLUTION
Shahid12523
Community Champion
Community Champion

Create a calculated column or measure like this:
LatestPlus5Days =
CALCULATE(
MAX('YourTable'[Date]) + 5,
ALLEXCEPT('YourTable', 'YourTable'[Product])
)


- MAX('YourTable'[Date]) gets the latest date per product.
- + 5 adds 5 days.

- ALLEXCEPT ensures the calculation respects each product group.

Shahed Shaikh

View solution in original post

4 REPLIES 4
Shahid12523
Community Champion
Community Champion

Create a calculated column or measure like this:
LatestPlus5Days =
CALCULATE(
MAX('YourTable'[Date]) + 5,
ALLEXCEPT('YourTable', 'YourTable'[Product])
)


- MAX('YourTable'[Date]) gets the latest date per product.
- + 5 adds 5 days.

- ALLEXCEPT ensures the calculation respects each product group.

Shahed Shaikh

Gonna start tagging you in future questions 🤣 @Shahid12523  you're a star, thank you! Still working on my DAX, wish I could write it this easily!

danextian
Super User
Super User

Hi @samc_26 

 

Use DAX since the number of days to add is defined by a measure.  Create the following measures:

Max Date Per Product = 
CALCULATE ( MAX ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[Product] ) )
Max Date + 5 Days = 
[Max Date Per Product] + [Days to Add]

danextian_0-1757070770974.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Royel
Super User
Super User

HI @samc_26  lets do it with help of power query 

let
    // Replace "Source" with your actual data source
    Source = Table.FromRows({
        {"Pencil", #date(2025, 7, 8)},
        {"Pencil", #date(2025, 8, 15)},
        {"Book", #date(2025, 4, 1)},
        {"Book", #date(2025, 5, 23)}
    }, {"Product", "Date"}),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Product", type text}, {"Date", type date}}),
    
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Product"}, {
        {"Latest Date", each List.Max([Date]), type nullable date}
    }),
    #"Added Days" = Table.AddColumn(#"Grouped Rows", "Adding 5 days to latest date", 
        each Date.AddDays([Latest Date], 5), type date)
in
    #"Added Days"

Results: 

Royel_0-1757069918506.png

 

Find this helpful? ✔ Give a Kudo • Mark as Solution – help others too!

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.