Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
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:
| Product | Date |
| Pencil | 08/07/25 |
| Pencil | 15/08/25 |
| Book | 01/04/25 |
| Book | 23/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:
| Product | Latest Date | Adding 5 days to latest date |
| Pencil | 15/08/25 | 20/08/25 |
| Book | 23/05/25 | 28/05/25 |
If anyone can work this out for me that would be great!
Solved! Go to Solution.
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.
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.
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!
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]
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:
Find this helpful? ✔ Give a Kudo • Mark as Solution – help others too!
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 54 | |
| 47 | |
| 38 | |
| 16 | |
| 15 |
| User | Count |
|---|---|
| 83 | |
| 71 | |
| 38 | |
| 28 | |
| 25 |