Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
In Power BI, I forecasted Value column using R in the Power Query editor. Then, once I had the forecasted value, I appended it to the original table, which resulted in something like this:
| Date | Value |
| 1/01/2021 | 5245 |
| 2/01/2021 | 3214 |
| 3/01/2021 | 7458 |
| 4/01/2021 | 36314 |
| 5/01/2021 | 5478 |
| 2314 | |
| 5478 | |
| 63211 | |
| 2314 | |
| 52336 | |
| 1247 |
Now I want to add date to the projected values, creating rolling date rows that keeps groowing as the number of rows grows.
The final value should seem as follows:
| Date | Value |
| 1/01/2021 | 5245 |
| 2/01/2021 | 3214 |
| 3/01/2021 | 7458 |
| 4/01/2021 | 36314 |
| 5/01/2021 | 5478 |
| 6/1/2021 | 2314 |
| 7/1/2021 | 5478 |
| 8/1/2021 | 63211 |
| 9/1/2021 | 2314 |
| 10/1/2021 | 52336 |
| 11/1/2021 | 1247 |
OR
Add a new date column as follows:
| Date | Value | New Date |
| 1/01/2021 | 5245 | 1/01/2021 |
| 2/01/2021 | 3214 | 2/01/2021 |
| 3/01/2021 | 7458 | 3/01/2021 |
| 4/01/2021 | 36314 | 4/01/2021 |
| 5/01/2021 | 5478 | 5/01/2021 |
| 2314 | 6/1/2021 | |
| 5478 | 7/1/2021 | |
| 63211 | 8/1/2021 | |
| 2314 | 9/1/2021 | |
| 52336 | 10/1/2021 | |
| 1247 | 11/1/2021 |
I did a lot of googling and spent a lot of time on this (almost half a day), but I couldn't find anything useful. And now the Power BI community is my only hope. Any help would be highly appreciated. 🙂
Solved! Go to Solution.
@Anonymous , First add an index column in power query https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi
Post that in DAX create a new column
new date =
var _max = maxx(filter(Table, not(isblank([Date])), [index])
var _maxd = maxx(filter(Table, not(isblank([Date])), [Date])
return
if(not(isblank([Date])), [Date],_maxd + [Index]-_max)
@Anonymous , First add an index column in power query https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi
Post that in DAX create a new column
new date =
var _max = maxx(filter(Table, not(isblank([Date])), [index])
var _maxd = maxx(filter(Table, not(isblank([Date])), [Date])
return
if(not(isblank([Date])), [Date],_maxd + [Index]-_max)
OMG, it works, I cannot thank you enough for this. Thank you so much!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.