Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. 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!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 52 | |
| 44 | |
| 44 | |
| 20 | |
| 19 |
| User | Count |
|---|---|
| 71 | |
| 70 | |
| 34 | |
| 33 | |
| 31 |