Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi,
I have a Power Query which produces an expanded list of dates from the start and ed date columns in my table. One part is:
if EndDate = null then (Date.From ( DateTime.LocalNow() ) else EndDate
This means that the end date is effectively taken as today's date if nothing is given there. However, I want this to dynamically change to be today's date plus 2 years such that when I refresh the data it automatically updates this. This is so that I can look ahead to forecasting figures rather than taking a backward looking view.
Any ideas greatly appreciated!
Did you try Date.AddYears()?
See below.
If it helps, mark it as a solution
Kudos are nice too
ok brill thanks. What if I wanted the date to be the maximum of a particular column (e.g. the maximum date in the end date field) rather than a 2 years fixed from each day going forward?
You need to user GROUP BY as below.
After that expand the Expansion column.
Then create a column as below.
Then delete the unnecessary columns.
If it hleps, mark it as a solution
Kudos are nice too
and what if that end date is in a different table?
for instance I see this here (https://stackoverflow.com/questions/50457881/how-to-find-the-most-current-date-from-a-column-in-powe...) but when I try it it only allows me to use columns in the table I then used with this custom function.
Check out the April 2026 Power BI update to learn about new features.
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.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 4 |